﻿
var number=9;
function Menu_Change(selID)
{
	for(var i=1;i<=number;i++)
	{
		if(i==selID)
		{
			$('m'+i).className = "M_green";
			$('search_mid').className = "search_mid" +i;
		}
		else
		{
			$('m'+i).className = "M_yellow";
		}
	}
}
function fClear()
{
	$('KeyWord').value = '';
}
/////////////////////////////////////////////////
	//镜像
function SetTEL()
{
	var mydate = new Date();
	mydate.setTime(mydate.getTime() + 315360000000);
	document.cookie = "zz_area=TEL;expires=" + mydate.toGMTString() + ";domain=mytenfu.com";
	Get();
}

function SetCNC()
{
	var mydate = new Date();
	mydate.setTime(mydate.getTime() + 315360000000);
	document.cookie = "zz_area=CNC;expires="+ mydate.toGMTString() + ";domain=mytenfu.com";
	Get();
}

 function GetCookie(name)
 {
     var arg=name+ "=";
     var alen=arg.length;
     var clen=document.cookie.length;
     var i=0;
     while (i<clen) {
       var j=i+alen;
       if(document.cookie.substring(i,j)
       ==arg)
       return getCookieVal(j);
       i=document.cookie.indexOf("",i)+1;
       if(i==0)break;
     }
     return null;
   }
   
   
   function getCookieVal(offset) {
     var endstr=document.cookie.indexOf
       (";",offset);
     if(endstr==-1)
       endstr=document.cookie.length;
     return unescape(document.cookie.substring
       (offset,endstr));
   }

//COOKIE
function Get()
{		
	var cookieEnabled=(navigator.cookieEnabled)? true : false;
	//ie4+ns6+
	if (typeof navigator.cookieEnabled=="undefined" && !cookieEnabled)
	{ 
		document.cookie="testcookie";
		cookieEnabled=(document.cookie=="testcookie")? true : false;
		document.cookie=""; //erase dummy value
	}
	
	if (cookieEnabled)
	{		
		var CookieArea = GetCookie('zz_area');
		//var CookieArea = "CNC";
		if (CookieArea == "CNC")
		{		
			//this.location = "http://www1.mytenfu.com/index.asp";
			location.href = "http://www1.mytenfu.com/index.asp";
		}
		else
		{
			
			if (CookieArea == "TEL")
			{
				//this.location = "http://www.mytenfu.com/index.asp";
				location.href = "http://www.mytenfu.com/index.asp";
			}
		}
	}
	else
	{		
		this.location = "http://www.mytenfu.com/index.asp";
	}
}
//



     function wCncTel()
	 {
		document.writeln('<a href="javascript:SetCNC()" class="link_red" title="网通镜像"><img src="/__images/cnclogos.jpg" alt="网通镜像" border="0">网通镜像</a> <a href="javascript:SetTEL()" class="link_red" title="电信镜像"><img src="/__images/tellogos.gif" alt="电信镜像" border="0">电信镜像</a>');
	 }


//-------------------------------------------
function selFocus()
{
	//$("selKeyWord").value="";
	if ($('selKeyWord').value=="请输入关键字搜索如：番茄")
	{
		$("selKeyWord").value="";
	}
}
function selBlur()
{
	if($F("selKeyWord")=="")
	{
		$("selKeyWord").value= "请输入关键字搜索如：番茄";
	}
}


//-------------------proclass Order

function fProOrder(tmp,ClassID)
{
	var url = '' ;
	if (tmp =='priceH')
	{
		url ='class-ph-' + ClassID + '.html';
	}
	if (tmp =='priceL')
	{
		url ='class-pl-' + ClassID + '.html';
	}
	if (tmp =='viewnumH')
	{
		url ='class-vh-' + ClassID + '.html';
	}
	if (tmp =='viewnumL')
	{
		url ='class-vl-' + ClassID + '.html';
	}
	if (tmp =='sellnumH')
	{
		url ='class-sh-' + ClassID + '.html';
	}
	if (tmp =='sellnumL')
	{
		url ='class-sl-' + ClassID + '.html';
	}
	if (tmp =='onshelfF')
	{
		url ='class-of-' + ClassID + '.html';
	}
	if (tmp =='onshelfO')
	{
		url ='class-oo-' + ClassID + '.html';
	}
	window.location = url;
}
// 推荐朋友
function tjpy(i)
{
	//$('pro_tj').style = "display:block;";
	if(i==1)
	{
		Element.show("pro_tj");
	}
	else
	{
		Element.hide("pro_tj");
	}
	
}


