// common JavaScript functions
function handleSWFembed(sfwPath,swfW,swfH,swfQ){
	var agt		= navigator.userAgent.toLowerCase();
	var isIE	= agt.indexOf("msie");
	var res		= '<embed src="'+swfPath+'" quality="'+swfQ+'" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'+swfW+'" height="'+swfH+'" />';
	/*var swfPath	= "images/Header.swf";
	var swfW	= 640;
	var swfH	= 150;
	var swfQ	= "high";*/
  	return res;
}
//
var popUpWin;
function popUpDetailes(path,w,h){
	if(w==null) w = 480;
	if(h==null) h = 250;
	if(path==null) return;
	//
	if(popUpWin!=null) if(!popUpWin.closed && popUpWin.location) popUpWin.window.close();
	//
	popUpWin= window.open(path, "popUpWin", "toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,width="+w+",height="+h+",left = 100,top = 100");
}
//
function markCurrentSectionByID(sectionID){
	var Obj= document.getElementById(sectionID); if(Obj==null)return;
	Obj.style.color= "#336699";
	//
	var Obj= document.getElementById("sub_" + sectionID); if(Obj==null)return;
	Obj.style.color= "#336699";
}
//
function markItemByID(itemID){
	var obj= document.getElementById(itemID);if(obj==null)return;
	obj.style.backgroundColor= "#FFFFCC";
}
//
function popupDeleteWarning(url,msg){
	if(url==null || msg == null) return;
	warning= confirm(msg);
	if(warning == true)this.location.href=url;
	return;
}
//
function deleteGallery(formName,msg){
	if(formName==null || msg == null) return;
	//
	warning	= confirm(msg);
	//
	if(warning == true){
		document.deletegallery.submit();
	}
	//
	return;
}
//show OR hide function
function ShowHideElementByID(id) {
	if (document.getElementById) { // DOM3 = IE5, NS6
		if(document.getElementById(id).style.display == "none"){
			document.getElementById(id).style.display = 'block';
		}else document.getElementById(id).style.display = 'none';
	}else{
		if(document.layers){
			if(document.id.display == "none"){ document.id.display = 'block'; }else document.id.display = 'none';
		}else{
			if(document.all.id.style.visibility == "none"){
				document.all.id.style.display = 'block';
			} else document.all.id.style.display = 'none';
		}
	}
}
//
function HideElementByID(id) {
	if (document.getElementById) { // DOM3 = IE5, NS6
		if(document.getElementById(id).style.display == "block")
			document.getElementById(id).style.display = 'none';
	}else{
		if(document.layers){
			if(document.id.display == "block") document.id.display = 'none';
		}else{
			if(document.all.id.style.visibility == "block") document.all.id.style.display = 'none';
		}
	}
}
//
function ShowElementByID(id) {
	alert("ShowElementByID => "+id);
	if (document.getElementById) { // DOM3 = IE5, NS6
		if(document.getElementById(id).style.display == "none")
			document.getElementById(id).style.display = 'block';
	}else{
		if(document.layers){
			if(document.id.display == "none") document.id.display = 'block';
		}else{
			if(document.all.id.style.visibility == "none") document.all.id.style.display = 'block';
		}
	}
}
//
function expandDiv(divID){
	for(i=0;i<divs_list.length;i++)
		if(divs_list[i]!=divID)HideElementByID(divs_list[i]);
	//
	ShowElementByID(divID);
}
//
function initDIVs(){
	for(i in divs_list)
		ShowHideElementByID(divs_list[i]);
}
/*
=> WYSIWYG JavaApplet Functions:
*/
//Preview HTML Document
function WYSIWYG_F_open_doc_preview() {
	//open new browser window
	docpreview=window.open('', 'docpreview', 'dependent, height=500, width=660, menubar=no, resizable=yes, scrollbars=yes, status=yes, toolbar=no');
	//write code on window
	var preview	= WYSIWYG_preview_page
	docpreview.document.write(preview.replace("%content%",document.article_form.articlecontentarea.value));
}

// copy html code from JXHTMLEdit to textarea
function WYSIWYG_saveCode() {
	if (appletReady) {
		try {
			document.article_form.articlecontentarea.value=document.jxhtmleditA.getCode();
		} catch(er) {
			document.article_form.articlecontentarea.value=document.jxhtmleditB.getCode();
		}
	}
	//
	document.article_form.submit();
}

// copy html code from textarea to JXHTMLEdit
function WYSIWYG_loadCode() {
	if (appletReady) {
		try {
			document.jxhtmleditA.setCode(document.article_form.articlecontentarea.value);
		} catch(er) {
			document.jxhtmleditB.setCode(document.article_form.articlecontentarea.value);
		}
	}
}
// Preview page
var WYSIWYG_preview_page	= '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"><head><link href="../css/css.css" type="text/css" rel="stylesheet" /><style type=\'text/css\'>p{padding:0; margin:0;} img{float:left;}</style><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/><title>Article Preview</title><link href="../css/css.css" type="text/css" rel="stylesheet" /></head><body><table width="550" cellpadding="0" cellspacing="0" border="0"><tr><td><table width="100%" border="0" cellpadding="0" cellspacing="0"><tr><td><table width="100%" border="0" cellpadding="0" cellspacing="0">	<tr class="borderCells_w_images_tr">		<td style="background-image: url(\'images/boxes/box_white_lt_corner.gif\');" width="12" height="9">&nbsp;</td>		<td style="background-image: url(\'images/boxes/box_white_t_border.gif\');" >&nbsp;</td>		<td style="background-image: url(\'images/boxes/box_white_rt_corner.gif\');" width="17">&nbsp;</td>	</tr></table><table width="100%" border="0" cellpadding="0" cellspacing="0">	<tr>	<td style="background-image: url(\'images/boxes/box_white_l_border.gif\');" width="4">&nbsp;</td>		<td class="white_box_content_td" height="500">		<div class="box_content_position_div">%content%</div>			</td>		<td style="background-image: url(\'images/boxes/box_white_r_border.gif\');" width="9">&nbsp;</td>	</tr></table><table width="100%" border="0" cellpadding="0" cellspacing="0">	<tr class="borderCells_w_images_tr">		<td style="background-image: url(\'images/boxes/box_white_lb_corner.gif\');" width="12" height="14">&nbsp;</td>		<td style="background-image: url(\'images/boxes/box_white_b_border.gif\');">&nbsp;</td>		<td style="background-image: url(\'images/boxes/box_white_rb_corner.gif\');" width="17">&nbsp;</td>	</tr></table></td></tr></table></td></tr></table></body></html>';
/*
=> WYSIWYG JavaApplet Functions => END =|
*/