
browserName = navigator.appName;
browserVer = parseInt(navigator.appVersion);
condition = !(( (browserName.indexOf("Explorer") >=0 ) && (browserVer < 4) ) ||  ((browserName.indexOf("Netscape") >=0 ) && (browserVer < 2) ) ) ;
if (condition == true  )
    CanAnimate = true;
else
    CanAnimate = false;
function translator(pattern)
{
/////////////////////////////////////////////////////////////
// Script to use language convertor
// By Saradhi
/////////////////////////////////////////////////////////////

	/// Configuration parameters //////////////
	var open_in_same_window = 0;
	//////////// End Of Configuration /////////////

	var my_location = unescape(document.location.toString());
	var new_location ='';
	var new_pattern = '';
	if (my_location.indexOf('translate_c?') != -1) {
		/// From google...
		var indexof_u = my_location.indexOf('u=');
		if (indexof_u == -1) {
			new_location = document.location;
		}
		else {
			var subs = my_location.substring(indexof_u, my_location.length);
			var ss = subs.split('&');
			new_location = ss[0].substring(2, ss[0].length);
		}
	}
	else {
		new_location = document.location;
	}

	indexof_p = pattern.indexOf('|');

	var isen = '';
	if (indexof_p == -1) {
		indexof_p1 = pattern.indexOf('><');
		if (indexof_p1 == -1) {
			new_pattern = pattern;
			if (pattern == 'en') {
				isen = 1;
			}
		}
		else {
			var psplit =pattern.split('><');
			new_pattern = psplit[0]+'|'+psplit[1];
			if (psplit[1] == 'en') {
				isen = 1;
			}
		}
	}
	else {
		var psplit = pattern.split('|');
		new_pattern = psplit[0]+'|'+psplit[1];
		if (psplit[1] == 'en') {
			isen = 1;
		}
	}

	var thisurl = '';
	if (isen == 1) {
		thisurl = new_location;
	}
	else {
		thisurl = 'http://translate.google.com/translate_c?langpair=' + new_pattern + "&u=" + new_location;
	}

	if (open_in_same_window == 1) {
		window.location.href = thisurl;
	}
	else {
		if (CanAnimate ){
			msgWindow=window.open('' ,'subwindow','toolbar=yes,location=yes,directories=yes,status=yes,scrollbars=yes,menubar=yes,resizable=yes,left=0,top=0');
			msgWindow.focus();
			msgWindow.location.href = thisurl;
		}
		else {
			msgWindow=window.open(thisurl,'subwindow','toolbar=yes,location=yes,directories=yes,status=yes,scrollbars=yes,menubar=yes,resizable=yes,left=0,top=0');
		}
	}
}

function translator1(pattern)
{
	var thisurl = 'http://translate.google.com/translate_c?langpair=' + pattern + "&u=" + document.location;
	if (CanAnimate ){
        	msgWindow=window.open('' ,'subwindow','toolbar=yes,location=yes,directories=yes,status=yes,scrollbars=yes,menubar=yes,resizable=yes,left=0,top=0');
	        msgWindow.focus();
        	msgWindow.location.href = thisurl;
	}
	else {
        	msgWindow=window.open(thisurl,'subwindow','toolbar=yes,location=yes,directories=yes,status=yes,scrollbars=yes,menubar=yes,resizable=yes,left=0,top=0');
	}
}

function ImgAutoGlobal(i,w,h){
var MaxW=w;
var MaxH=h;
var o=new Image();o.src=i.src;var w=o.width;var h=o.height;var t;if (w>MaxW){t=MaxW;}else{t=w;}
if ((h*t/w)>MaxH){i.height=MaxH;i.width=MaxH/h*w;}else{i.width=t;i.height=t/w*h;}
}

function checkSearchForm(){
	if(document.ProductSearch.keyword.value==""){
		alert("please input the keyword!")
		 return false;
	}else{
		str   =   document.ProductSearch.keyword.value.replace(/\s+/g,""); 
		if (str==""){
			alert("please input the keyword!")
		 	return false;
		}else{
		document.ProductSearch.submit();
		return true;
		}
	}
}
function checkLoginForm(){
	if(document.Userlogin.UserEmail.value==""){
		alert("please input the UserEmail!")
		 return false;
	}else{
		str   =   document.Userlogin.UserEmail.value.replace(/\s+/g,""); 
		if (str==""){
			alert("please input the UserEmail!")
		 	return false;
		}else{
			if(document.Userlogin.UserPw.value==""){
				alert("please input the Password!")
		 		return false;
			}else{
				document.Userlogin.submit();
				return true;
			}
		}
	}
}

function starchina2(){
 sobjTimer2 =window.setInterval(change2,10);
    }
	

function moveBG(){
	document.Searchform.keyword.style.backgroundImage='url()';	
}
function outBG(){
	if(document.Searchform.keyword.value==""){
	document.Searchform.keyword.style.backgroundImage='url(../images/productname.gif)';
	}else{
	document.Searchform.keyword.style.backgroundImage='url()';	
	}
}
function moveBG_p(){
	document.Searchform.keyword.style.backgroundImage='url()';	
}
function outBG_p(){
	if(document.Searchform.keyword.value==""){
	document.Searchform.keyword.style.backgroundImage='url(../images/keywordtext.gif)';
	}else{
	document.Searchform.keyword.style.backgroundImage='url()';	
	}
}
function showText(i){
	if(document.getElementById("id"+i).style.display=="none"){
	document.getElementById("id"+i).style.display="block"
	}else{
	document.getElementById("id"+i).style.display="none"
	}
}

function showSearchBar(){
	document.getElementById("SearchBar").style.display="Block";
}
function closeSearchBar(){
	document.getElementById("SearchBar").style.display="none";
}
function showAlt(){
	document.getElementById("alt").style.display="Block";
}
function closeAlt(){
	document.getElementById("alt").style.display="none";
}

var NowFrame = 1;var MaxFrame = 5;var bStart = 0;function fnToggle(){var next = NowFrame + 1;if(next == MaxFrame+1) 
{NowFrame = MaxFrame;next = 1;}if(bStart == 0){bStart = 1;setTimeout('fnToggle()', 2000);return;}else{oTransContainer.filters[0].Apply();
document.images['oDIV'+next].style.display = "";document.images['oDIV'+NowFrame].style.display = "none";oTransContainer.filters[0].Play(duration=2);
if(NowFrame == MaxFrame){NowFrame = 1;}else{NowFrame++;}}setTimeout('fnToggle()', 6000);}fnToggle();