﻿	function listShow(obj)
	{
		if(obj.getAttribute("link")=="")
		{
			var goid = obj.id;
			var str = document.getElementById("ProductList1_DDL_page").className;
			var topid = str.substring(str.indexOf('SID'),str.length).replace('SID=','');
			location.href = 'List.aspx?CID=' + goid + '&SID=' + topid;
		}
		else
		{
			window.open(obj.getAttribute("link"),obj.getAttribute("open"));	
		}
		//var isIE=navigator.appName.indexOf("Internet Explorer")>0?true:false;
//		if(obj.getAttribute("link")=="")
//		{
//			removeNull(obj.parentNode);
//			var currentDIV=obj.parentNode.childNodes[1];
//			var div=document.getElementById("index").getElementsByTagName("div");
//			for(var i=0;i<div.length;i++)
//			{
//				if(div[i].className=="items"&&div[i]!=currentDIV)
//				{
//					div[i].style.display="none";
//				}
//				if(div[i].childNodes.length>0&&div[i].childNodes[0].tagName=="SPAN")
//				{
//					var span=div[i].childNodes[0];
//					if(isIE)
//					{
//						span.filters.Gray.enabled=true;
//					}
//					else
//					{
//						span.style.opacity=0.4;
//						if(span.getAttribute("name")!="last")
//						{
//							removeNull(span);
//							span.childNodes[1].style.backgroundColor="gray";
//						}
//					}
//					if(span.getAttribute("name")=="last")
//					{
//						span.style.color="#C3C4C8";	
//					}
//				}
//			}
//			currentDIV.style.display=currentDIV.style.display=="none"?"block":"none";
//			if(isIE)
//			{
//				currentDIV.parentNode.childNodes[0].filters.Gray.enabled=false;
//			}
//			else
//			{
//				currentDIV.parentNode.childNodes[0].style.opacity=1.0;
//				removeNull(currentDIV.parentNode.childNodes[0]);
//				currentDIV.parentNode.childNodes[0].childNodes[1].style.backgroundColor="#EE3226";
//			}
//			while(currentDIV.parentNode.id!="index")
//			{
//				currentDIV=currentDIV.parentNode;		
//				if(currentDIV.className=="items")
//				{
//					if(isIE)
//					{
//						currentDIV.parentNode.childNodes[0].filters.Gray.enabled=false;
//					}
//					else
//					{
//						currentDIV.parentNode.childNodes[0].style.opacity=1.0;
//						removeNull(currentDIV.parentNode.childNodes[0]);
//						currentDIV.parentNode.childNodes[0].childNodes[1].style.backgroundColor="#EE3226";
//					}
//					currentDIV.style.display="block";
//				}
//			}
//			startHTTP(obj.id);
//		}
//		else
//		{
//			window.open(obj.getAttribute("link"),obj.getAttribute("open"));	
//		}
	}
	function Show(obj)
	{
		if(obj.getAttribute("link")=="")
		{
			var goid = obj.id;
			var str = document.getElementById("ProductList1_DDL_page").className;
			var topid = str.substring(str.indexOf('SID'),str.length).replace('SID=','');
			location.href = 'List.aspx?CID=' + goid + '&SID=' + topid;
		}
		else
		{
			window.open(obj.getAttribute("link"),obj.getAttribute("open"));	
		}
		//var isIE=navigator.appName.indexOf("Internet Explorer")>0?true:false;
//		if(isIE)
//		{
//			obj.filters.Gray.enabled=false;
//		}
//		var sp=obj.parentNode.parentNode.getElementsByTagName("span")
//		for(var i=0;i<sp.length;i++)
//		{
//			if(sp[i].getAttribute("name")=="last")
//			{
//				if(isIE)
//				{
//					sp[i].filters.Gray.enabled=true;
//				}
//				else
//				{
//					sp[i].style.opacity=0.4;
//				}
//				sp[i].style.color="#C3C4C8";
//			}
//		}
//		if(isIE)
//		{
//			obj.filters.Gray.enabled=false;
//		}
//		else
//		{
//			obj.style.opacity=1.0;	
//		}
//		obj.style.color="#000000";
//		
//		if(obj.getAttribute("link")=="")
//		{
//			startHTTP(obj.id);
//		}
//		else
//		{
//			window.open(obj.getAttribute("link"),obj.getAttribute("open"));
//		}
	}
	
	function searchlistShow(obj)
	{
		if(obj.link=="")
		{
			var currentDIV=obj.parentNode.childNodes[2];
			var div=document.getElementById("index").getElementsByTagName("div");
			for(var i=0;i<div.length;i++)
			{
				if(div[i].className=="items")
				{
					div[i].style.display="none";
				}
				if(div[i].childNodes.length>0&&div[i].childNodes[0].tagName=="SPAN")
				{
					var span=div[i].childNodes[0];
					span.filters.Gray.enabled=true;
					if(span.name=="last")
					{
						span.style.color="#C3C4C8";	
					}
				}
			}
			currentDIV.style.display=currentDIV.style.display=="none"?"block":"none";
			currentDIV.parentNode.childNodes[0].filters.Gray.enabled=false;
			while(currentDIV.parentNode.id!="index")
			{
				currentDIV=currentDIV.parentNode;
						
				if(currentDIV.className=="items")
				{
					currentDIV.parentNode.childNodes[0].filters.Gray.enabled=false;
					currentDIV.style.display="block";
				}
			}
			window.location.href="/list.aspx?CID="+obj.id;
		}
		else
		{
			window.open(obj.link);	
		}
	}
	function searchShow(obj)
	{
		obj.filters.Gray.enabled=false;
		var sp=obj.parentNode.parentNode.getElementsByTagName("span")
		for(var i=0;i<sp.length;i++)
		{
			if(sp[i].name=="last")
			{
				sp[i].filters.Gray.enabled=true;
				sp[i].style.color="#C3C4C8";
			}
		}
		obj.filters.Gray.enabled=false;
		obj.style.color="#000000";
		if(obj.link=="")
		{
			window.location.href="/list.aspx?CID="+obj.id;
		}
		else
		{
			window.open(obj.link);	
		}
	}
	
	
	function QueryString() {
		var search=location.search;
		if(search!="")
		{
			search=search.replace("?","");
			var P=search.split('&');
			var value="";
			for(var i=0;i<P.length;i++)
			{
				if(P[i].split('=')[0]=="SID")	
				{
					value=P[i].split('=')[1];
					break;
				}
			}
			return value;
		}
		else
		{
			return "";	
		}
		//return '<%=Request.QueryString["CID"]%>';                                  // Return the object
	} 
	function QueryStringCID() {
		var search=location.search;
		if(search!="")
		{
			search=search.replace("?","");
			var P=search.split('&');
			var value="";
			for(var i=0;i<P.length;i++)
			{
				if(P[i].split('=')[0]=="CID")	
				{
					value=P[i].split('=')[1];
					break;
				}
			}
			return value;
		}
		else
		{
			return "";	
		}
		//return '<%=Request.QueryString["CID"]%>';                                  // Return the object
	} 
	function QueryPString() {
		var search=location.search;
		if(search!="")
		{
			earch=search.replace("?","");
			var P=search.split('&');
			var value="";
			for(var i=0;i<P.length;i++)
			{
				if(P[i].split('=')[0]=="FID")	
				{
					value=P[i].split('=')[1];
					break;
				}
			}
			return value;
		}
		else
		{
			return "";	
		}                              // Return the object
	} 
