var xurl = document.location.href;
var yurl = xurl.split("/");
var sub_dir = yurl[4].split(".");
var sub_dir = sub_dir[0].toLowerCase();

function MM_swapImage() {
	var i,j=0,x,a=MM_swapImage.arguments;
	document.MM_sr=new Array;
	for(i=0;i<(a.length-2);i+=3)
		if ((x=MM_findObj(a[i]))!=null){
			document.MM_sr[j++]=x;
			if(!x.oSrc)
				x.oSrc=x.src;
			x.src=a[i+2];
		}
}
function MM_findObj(n, d) { //v4.0
	var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
	d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
	if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
	for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
	if(!x && document.getElementById) x=document.getElementById(n); return x;
}
function MM_swapImgRestore() {
	var i,x,a=document.MM_sr;
	for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++)
		x.src=x.oSrc;
}
function open_scroll_no(xurl, tar, wid, hei){
	set = 'width='+wid+',height='+hei+',left=0,top=0,toolbar=no,location=no,directory=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no'
	window.open(xurl,tar,set);
}
function open_scroll_yes(xurl, tar, wid, hei){
	set = 'width='+wid+',height='+hei+',left=0,top=0,toolbar=no,location=no,directory=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no'
	window.open(xurl,tar,set);
}
// flash
function flash_wf(flash_name,flash_width,flash_height,flash_id,wmd,idx){
	document.write(" \
		<Object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0' WIDTH='"+flash_width+"' HEIGHT='"+flash_height+"' id='"+flash_id+"' ALIGN=''> \
		<PARAM NAME=movie VALUE='"+flash_name+"'> \
		<PARAM NAME=quality VALUE=high> \
	");
	if( wmd == '1' ){
		document.write(" \
			<PARAM NAME=wmode VALUE=transparent> \
		");
	}
	if( idx != '' ){
		document.write(" \
			<param name=flashvars value='"+idx+"'> \
		");
	}
	if( wmd == '1' ){
		if( idx != '' ){
			document.write(" \
				<EMBED src='"+flash_name+"' flashvars='"+idx+"' wmode='transparent' quality=high  WIDTH='"+flash_width+"' HEIGHT='"+flash_height+"' NAME='"+flash_id+"' ALIGN='' TYPE='application/x-shockwave-flash' PLUGINSPAGE='http://www.macromedia.com/go/getflashplayer'> \
			");
		}else{
			document.write(" \
				<EMBED src='"+flash_name+"' wmode='transparent' quality=high  WIDTH='"+flash_width+"' HEIGHT='"+flash_height+"' NAME='"+flash_id+"' ALIGN='' TYPE='application/x-shockwave-flash' PLUGINSPAGE='http://www.macromedia.com/go/getflashplayer'> \
			");
		}
	}else{
		if( idx != '' ){
			document.write(" \
				<EMBED src='"+flash_name+"' flashvars='"+idx+"' quality=high  WIDTH='"+flash_width+"' HEIGHT='"+flash_height+"' NAME='"+flash_id+"' ALIGN='' TYPE='application/x-shockwave-flash' PLUGINSPAGE='http://www.macromedia.com/go/getflashplayer'> \
			");
		}else{
			document.write(" \
				<EMBED src='"+flash_name+"' quality=high  WIDTH='"+flash_width+"' HEIGHT='"+flash_height+"' NAME='"+flash_id+"' ALIGN='' TYPE='application/x-shockwave-flash' PLUGINSPAGE='http://www.macromedia.com/go/getflashplayer'> \
			");
		}
	}
	document.write(" \
		</EMBED> \
		</OBJECT> \
	");
}
// menu link
function GoMenu(obj) {
	//alert(obj);
	switch (obj){

		case "1" :
			location.href= "/eng/main/mainAction/Init.do";
		break;
		//company
		case "100" :
			location.href= "/eng/company/company_navigation/Overview.do";
		break;
		case "110" :
			location.href= "/eng/company/company_navigation/Overview.do";
		break;
		case "120" :
			location.href= "/eng/company/company_navigation/History.do";
		break;
		case "130" :
			location.href= "/eng/company/company_navigation/Vision.do";
		break;
		case "140" :
			location.href= "/eng/company/company_navigation/Ceo.do";
		break;
		case "150" :
			location.href= "/eng/company/company_navigation/Location.do";
		break;
		// Product
		case "200" :
			location.href= "/eng/product/product_list/Product_View_SMF.do";
		break;
		case "210" :
			location.href= "/eng/product/product_list/Product_View_SMF.do";
		break;
		case "220" :
			location.href= "/eng/product/product_list/Product_View_TSMF.do";
		break;
		case "230" :
			location.href= "/eng/product/product_list/Product_View_SC.do";
		break;
		// Media Center
		case "300" :
			location.href= "/eng/media/media_list/Movie_List.do";
		break;
		case "310" :
			location.href= "/eng/media/media_list/Movie_List.do";
		break;
		case "320" :
			location.href= "/eng/media/media_list/Brand_List.do";
		break;
		case "330" :
			location.href= "/eng/media/media_list/Display_List.do";
		break;
		case "340" :
			location.href= "/eng/media/media_list/News_List.do";
		break;
		// Technology
		case "400" :
			location.href= "/eng/technical/technical_list/Technical_Mf.do";
		break;
		case "410" :
			location.href= "/eng/technical/technical_list/Technical_Mf.do";
		break;
		case "420" :
			location.href= "/eng/technical/technical_list/Battery_Info.do";
		break;
		// Service&Support
		case "500" :
			location.href= "/eng/customer/customer_list/Catalog_List.do";
		break;
		case "510" :
			location.href= "/eng/customer/customer_list/Catalog_List.do";
		break;
		case "520" :
			location.href= "/eng/customer/customer_list/Certi_List.do";
		break;
		case "530" :
			location.href= "/eng/customer/customer_list/Msds_List.do";
		break;
		case "540" :
			location.href= "/eng/customer/customer_list/Contactus.do";
		break;
	}
}

// invisible image
function setPng24(obj) {
	obj.width=obj.height=1;
	obj.className=obj.className.replace(/\bpng24\b/i,'');
	obj.style.filter =
	"progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+ obj.src +"',sizingMethod='image');"
	obj.src='';
	return '';
}

//Family Site
function CHfamilysite(){
	document.getElementById("familysitelist").style.display = "block";
}
function CHfamilysiteOff(){
	document.getElementById("familysitelist").style.display = "none";
}
