/**********************************************************************************
	openwindow
***********************************************************************************/

function pop(pop,width,height,flag)
	{
		var url = pop;
		var wd = width;
		var he = height;

		if (flag == 0 ){
		window.open(url,"","toolbar=0,menubar=0,scrollbars=no,resizable=no,width=" + wd +",height=" + he + ";")
		}
		else{
		window.open(url,"","toolbar=0,menubar=0,scrollbars=auto,resizable=no,width=" + wd +",height=" + he + ";")
		}
	}



/********************************************************************************************************
	Layer Show Hide
********************************************************************************************************/

function LayerSH(LayerName,Status) {
ns4 = (document.layers)?true:false
ie4 = (document.all)?true:false

	if (ns4) {
		LayerN = document.layers[LayerName]
		if (Status == 'show') LayerN.visibility = 'show';
		if (Status == 'hide') LayerN.visibility = 'hidden';
	}
	if (ie4) {
		LayerN = document.all[LayerName].style
		if (Status == 'show') {
		LayerN.visibility = 'visible';
		LayerN.display = 'block';
		}
		if (Status == 'hide') {
		LayerN.visibility = 'hidden';
		LayerN.display = 'none';
		}
	}
}



/**********************************************************************************
	Support_Leftmenu
***********************************************************************************/





function isAlNum(ch){return ("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".indexOf(ch)==-1)?false:true;}
removeTags=function(str,myTags){
	var tags=['!--','!doctype','isindex','script','blockquote','style','input','plaintext','body','colgroup','fieldset','frameset','multicol','noframes','noscript','optgroup','textarea','basefont','acronym','address','caption','comment','listing','marquee','noembed','nolayer','bgsound','applet','button','center','iframe','ilayer','legend','nextid','object','option','select','server','spacer','strike','strong','keygen','blink','embed','label','layer','small','table','tbody','tfoot','thead','title','param','frame','abbr','area','cite','code','font','form','head','html','menu','nobr','ruby','samp','span','base','link','meta','bdo','big','del','dfn','dir','div','ins','kbd','map','pre','sub','sup','var','xmp','img','col','wbr','br','dd','dl','dt','em','h1','h2','h3','h4','h5','h6','li','ol','rb','rp','rt','td','th','tr','tt','ul','hr','a','b','i','p','q','s','u'];

	if(myTags){
		for(var i=0;i<myTags.length;i++){
			for(var j=0;j<tags.length;j++){
				if(myTags[i]==tags[j]){
					tags.splice(j,1);
					break;
				}
			}
		}
	}

	for(var i=0;i<tags.length;i++){
		str=removeTags.remove(str,tags[i]);
	}
	return str.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&#8260;/g,"\/");
};

removeTags.remove=function(str,tag){
	var op,tp,cp,lt,gt,copy;op=0,lt="&lt;",gt="&gt;";
	str=str.replace(/</g,"&lt;");
	str=str.replace(/>/g,"&gt;");
	str=str.replace(/\//g,"&#8260;");
	copy=str;
	str=str.toLowerCase();
	while((op=str.indexOf(lt+tag,op))!=-1){
		tp=str.substring(op+lt.length+tag.length,op+lt.length+tag.length+1)
		if(isAlNum(tp)) {op=op+lt.length+tag.length+1;continue;}
		if((cp=str.indexOf(lt+"&#8260;"+tag+gt,op))==-1){
			tp=str.indexOf(gt,op);
			str=str.substring(0,op)+str.substring(tp+4,str.length);
			copy=copy.substring(0,op)+copy.substring(tp+4,copy.length);
		}else{
			if((tag=="script")||(tag=="style")||(tag=="object")){
				tp=str.indexOf(gt,op);
				str=str.substring(0,op)+str.substring(cp+tag.length+9+6,str.length);
				copy=copy.substring(0,op)+copy.substring(cp+tag.length+9+6,copy.length);
			}else{
				tp=str.indexOf(gt,op);
				str=str.substring(0,op)+
					str.substring(tp+4,cp)+
					str.substring(cp+tag.length+9+6,str.length);
				copy=copy.substring(0,op)+
					copy.substring(tp+4,cp)+
					copy.substring(cp+tag.length+9+6,copy.length);				
			}
		}
	}
	return copy;
};


//Add trim() method to string object
String.prototype.trim = function(str) { 
	str = this != window ? this : str; 
	return str.replace(/^\s+/g,'').replace(/\s+$/g,''); 
	
}

function SetSection(cate1)
{

	if(cate1.length > 0)
	{	
	var imgName = "img_" + cate1.trim();
	
		if(typeof(document.all[imgName]) == "object")
		{
			document.all[imgName].src = document.all[imgName].src.replace('_off','_on');
			document.all[imgName].onmouseover = function(){ return false } 
			document.all[imgName].onmouseout = function(){ return false }
			
		}
	
	}
}


