	function catalog(id)	{			

			id= document.getElementById(id)
			
			if(id.style.display=='none'){
						id.style.display=''
			}else{
						 id.style.display='none'
			}			
	}
	
	
	function searchauto(code){
			
			file="autosearch&searchid="+code	
			file = "index.php?id="+file			

			page(file,'autosearch')			
	}
	
	function linkpage(linkto, code){	
			var file;			

			switch(linkto){		
									
							
							case "checkcart":
									file="checkcart"+code
								break
							
							case"service":
									file="service"
								break;
							
							case "news":
									file="news&"+code
								break;
								
							case "product":
									if(!code) code="";
									file= 'product&inner='+code
								break;
							
							case "detailpro":									
									file= 'detailpro&productid='+code
								break;
							
							case "addcart":
									file= 'addcart&productid='+code
								break;
							
							case "upcart":							
									file= 'upcart&sum='+code
									//alert(file)
								break;
								
							case "delcart":
									file= 'delcart&productid='+code
								break;
								
							case "viewcart":
									file= 'viewcart'
								break;
							
							case "signup":
									if(code){
													file= 'signup&act=submit'+code
									}else{
													file= 'signup'
									}
								break;
							
							case "login":								
													file= 'login'+code
								break;
							
							
							case "getpassword":
													if(code){
																file='getpassword'+code
													}else{
																file='getpassword'
													}
								break;
							
							case "howtobuy":
													file="howtobuy"
								break;
							
							case "introduction":
													file= "introduction"
								break;							
							
							case "contact":
													if(code){
																file = "contact"+code
													}else{
																file = "contact"
													}
													
								break;
							
							case "newpro":
													file="newpro"
								break;
							
							case "download":
													if(code){
																file = "download"+code
													}else{
																file = "download"
													}
								break;
								
							case "home":
													file="home"
								break;								
								
			}

			file = "index.php?id="+file			
			page(file,'body_home')
			page("index.php?cartshow=show","cartid")
			page("index.php?log=check","signup")
			page("index.php?id=online_ne","online_ne")			
			if(linkto=="detailpro") return nd();
	}
	


	function searchlinkto(title,id){
		document.search_form.keywords.value=title
		autosearch.style.display='none' 
		//linkpage('detailpro',id)		
		window.location = "index.php?id=detailpro&productid="+id
	}
	
	function logout(){
		 //window.location="index.php?id=offline"
		 page("index.php?id=offline","nothing")
	}
	
	function opennew(type, linkto, value)	{
			if(linkto)
			{
				advertise = window.open('http://'+linkto)	
			}else{
				var feature="alwaysRaised=yes, directories=no, location=no, menubar=no, resizable=no, scrollbars=yes, status=no, titlebar=no, toolbar=no, width=630px, height=450px  ";
				var advertise = window.open("index.php?id=popup&type="+type+'&idnew='+value,'',feature)
				//var x =	Math.round(window.screen.availHeight/4-150)
				//var y =	Math.round(window.screen.availWidth/4+150)
				var x= 220;
				var y = 180;
				advertise.moveTo(x,y)			
			}
						
			

	}
	
	function linkto(address){
		if(address) window.open("http://"+address)
	}
	
	function imagesize(image){
		alert(image)
	}
	
	function changeimage(name,image){
	
			var id = eval("document.getElementById('"+name+"')")
			
			id.innerHTML= "<img src=themes/default/imgs/vn/"+image+" height='33px'>"
	}

	function popupWindow(url) {
		  window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=400,height=330,screenX=220,screenY=200,top=150,left=150');
	}
	
	function hidden(){
		window.status = "Done"	
	}

// diplay Flash file
	function MM_swapImgRestore() { //v3.0
	  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 MM_preloadImages() { //v3.0
	  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
	    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
	    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
	}
	
	function MM_findObj(n, d) { //v4.01
	  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 && d.getElementById) x=d.getElementById(n); return x;
	}
	
	function MM_swapImage() { //v3.0
	  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];}
	}
// End diplay Flash file
	