var tio;
function show(fname)
{


	turnItTextColor();

	var el = document.getElementById("frMain");
	el.style.pixelHeight=50;
	frMain.location.href=fname;
	tio = setTimeout("resizebox()",0);
}
		  
function resizebox()
{
	var el = document.getElementById("frMain");
	el.style.pixelHeight+=50;
			  
	var ssh = frMain.document.body.scrollHeight;
	//document.all.jindu.innerText= ssh;
	if(el.style.pixelHeight<ssh)
	{  tio = setTimeout("resizebox()",0);
	}
	else
	{
	 clearTimeout(tio);
	}
	
}

function  turnItbg()
{
	var n = getCookie('titleSelect');
  
	for (i=1; i<=7 ; i++)
	{   

		var tdname  = "td"+i;
		
		var tdn = document.getElementById(tdname);

		if (i!=n)
			tdn.style.backgroundColor = "";
	    else
			tdn.style.backgroundColor = "#27ADF0";
	}
   
	
	if (n==1)
       window.parent.Main.location.href = "About_Us.htm";
    else if (n==2)
	{
		  var pro_dir = getCookie('dir');
		  if (pro_dir=='H') 
			{ window.parent.Main.location.href="ProductsAndServices/main.htm";
			}
			 else if (pro_dir=='S')
			{ window.parent.Main.location.href="ProductsAndServices/main2.htm";
			 }
			 else if (pro_dir=='I')
			{ window.parent.Main.location.href="ProductsAndServices/main3.htm";
			 }
	}
    else if (n==3)
		window.parent.Main.location.href = "blank.htm";
    else if (n==4)
		window.parent.Main.location.href = "blank.htm";
    else if (n==5)
		window.parent.Main.location.href = "Partners.htm";
    else if (n==6)
		window.parent.Main.location.href = "Support.htm";
	else if (n==7)
       window.parent.Main.location.href = "Contact_Us.htm";

}
function clearCookie()
{
    document.cookie = 'titleSelect=' + escape('0') ;
	document.cookie = 'dir=' + escape('0') ;
}
function setCookie(name,v ,vdir)
{ 
	document.cookie = name+'=' + escape(v) ;
	document.cookie = 'dir=' + escape(vdir) ;
	if (vdir=="H" || vdir=="S" || vdir=="I" )
		document.cookie = 'titleSelect='+ escape('2');
		
	 if (v=='2' && vdir=="d")
	 {
		// clearCookie();
	   //  var pro_file = getCookie('pro_file');
	    //alert (RequestString('ss'));
 	}
  
   

}

function getCookie(cookieName) {
  var cookieString = document.cookie;
  var start = cookieString.indexOf(cookieName + '=');
  if (start == -1) 
    return null;
  start += cookieName.length + 1;
  var end = cookieString.indexOf(';', start);
  if (end == -1) return unescape(cookieString.substring(start));
  return unescape(cookieString.substring(start, end));

}

function showfrContent()
{
  //var pro_file = getCookie('pro_file')
  //var el = document.getElementById("Main");
   var pro_dir = getCookie('dir')
   window.parent.Top.location.href="top.htm"
    if (pro_dir=='H') //Ó²¼þ
	{ 
		window.parent.Main.location.href="ProductsAndServices/main.htm";
	}
     else if (pro_dir=='S')
	{
      window.parent.Main.location.href="ProductsAndServices/main2.htm";
	 }
	else if (pro_dir=='I')
	{
		window.parent.Main.location.href="ProductsAndServices/main3.htm";
	}

	
}

function showSubfrContent()
{
   var pro_file = getCookie('pro_file');
   
   //alert (RequestString('ss'));
   

    
  //var el = document.getElementById("Main");
   var pro_dir = getCookie('dir');
   
   if (RequestString('ss')!=null)
   {
	  pro_file= "blank.htm";
    }
	   
   
  	var dirstr = "";
    if (pro_dir=='H') //Ó²¼þ
	{ dirstr +="POS_Hardware/"+pro_file;
	}
     else if (pro_dir=='S')
	{
      dirstr +="POS_Software/"+pro_file;
	 }
	else if(pro_dir=='I')
	{
		dirstr +="ID_Automation/"+pro_file;
	}
	else
      dirstr ="blank.htm";
	
	
	show(dirstr);

}

function OverThis(v,isTrue)
{
if (isTrue)
{
  var wd = v.width +5;
  var hd = v.height+5;
v.style.width = wd;
v.style.height = hd;
}
else
{
 var wd = v.width -5;
  var hd = v.height-5;
v.style.width = wd;
v.style.height = hd;
}
  //alert (wd+"**"+hd); 
}

function  turnItTextColor()
{
	var pro_file = getCookie('pro_file');
	 var pro_dir = getCookie('dir');
    if (RequestString('ss')!=null)
    {
	  pro_file= "blank.htm";
    }
	
    var n =0;  
	if (pro_dir=="H")
	{
		switch(pro_file)
		{   case "pos_4690.htm":  n=1;  break;
			case "pos_500.htm":   n=2 ; break;
			case "pos_700.htm":   n=3 ; break;
			case "pos_300.htm":   n=4 ; break;
			case "pos_SureOnePOS.htm":          n=5 ; break;
			case "pos_familyflatpanel.htm":     n=6 ; break;
			case "printer_SureMark.htm":        n=7 ; break;
			case "pos_HandheldTerminal.htm":    n=8 ; break;
			case "pos_HandheldScanQS600.htm":   n=9 ; break;
			case "pos_HandheldScanVS800.htm":   n=10 ; break; 
		}
     	try
		{
			for (i=1; i<=10 ; i++)
				{   
			
					var tdname  = "td"+i;
					
					var tdn = document.getElementById(tdname);
			
					if (i!=n)
						tdn.style.backgroundColor = "";
					else
						tdn.style.backgroundColor = "#aaaaaa";
				}
		}
  	 	catch(err)
		{}
	}
	else if (pro_dir=="S")
	{
		switch(pro_file)
		{   case "Soft_4690.htm":                   n=10 ; break;
			case "Soft_Supermarket.htm":     		n=11 ; break;
			case "Soft_GSA.htm":            		n=12 ; break;
			case "Soft_Value.htm":     				n=13 ; break;
			case "Soft_4690_DumpFormatter.htm":     n=14 ; break;
			case "Soft_4690_AutoOp.htm": 			n=15 ; break;
			case "Soft_4690_BGTaskManager.htm":     n=16 ; break;
			case "Soft_4690_EnhancedConsole.htm":   n=17 ; break;
			case "Soft_4690_SystemFileUpdate.htm":  n=18 ; break; 
			case "Soft_4690_ScreenSaver.htm":       n=19 ; break;
			case "Soft_4690_TaxTableGenerator.htm": n=20 ; break;
			case "Soft_4690_DataMiner.htm":         n=21 ; break;
			case "Soft_SalesExplore.htm":           n=22 ; break;
			case "Soft_PortalSystemDiagram.htm":    n=23 ; break;
			case "Soft_HealthExplorer.htm":         n=24 ; break;
			case "Soft_Pac_It.htm":         		n=25 ; break;
			case "Soft_Esception.htm":              n=26 ; break;
			case "2ndChance.htm":                   n=27 ; break;
			case "Soft_StoreGazer.htm":             n=28 ; break; 
			case "Soft_TimeTamer.htm":              n=29 ; break;
			case "Soft_TimeGuard.htm":              n=30 ; break;
			case "Soft_RingMaster.htm":             n=31 ; break; 
			case "Soft_POSZIP.htm":                 n=32 ; break;
			case "Soft_ROP_WinTCP.htm":             n=33 ; break; 
			case "Soft_Retalix_CompanyOverview.htm":             n=34 ; break; 
			case "Soft_Retalix_ProductOverview.htm":             n=35 ; break; 
			case "Soft_Retalix_LargeSupermarket.htm":             n=36 ; break; 
			case "Soft_Retalix_HostRema.htm":             n=37 ; break; 
			case "Soft_Retalix_BackOffice.htm":             n=38 ; break; 
			case "Soft_Retalix_MobilePocketOffice.htm":             n=39 ; break; 
			case "Soft_Retalix_SotrelinePOS.htm":             n=40 ; break; 
			case "Soft_Retalix_Fuel.htm":             n=41 ; break; 
			case "Soft_Retalix_HomeOrder.htm":             n=42 ; break; 
			case "Soft_Retalix_Customers.htm":             n=43 ; break; 
			case "Soft_Raymark_CompanyOverview.htm":             n=44 ; break; 
			case "Soft_Raymark_PointOfSale.htm":             n=45 ; break; 
			case "Soft_Raymark_PocketXpert.htm":             n=46 ; break; 
			case "Soft_Raymark_RetailIntelligence.htm":             n=47 ; break; 
			case "Soft_Raymark_Wholesale.htm":             n=48 ; break; 
			case "Soft_Raymark_PlanningAnalysis.htm":             n=49 ; break; 
			case "Soft_Raymark_Replication.htm":             n=50 ; break; 
			case "Soft_Raymark_Accounting.htm":             n=51 ; break; 
			case "Soft_Raymark_Reporting.htm":             n=52 ; break; 
			case "Soft_Raymark_Customers.htm":             n=53 ; break; 
		}
	

		try
	    {
		for (i=10; i<=53 ; i++)
			{   
		
				var tdname  = "td"+i;
				
				var tdn = document.getElementById(tdname);
		
				if (i!=n)
					tdn.style.backgroundColor = "";
				else
					tdn.style.backgroundColor = "#aaaaaa";
			}
		} catch (err)
	    {}
	}
	else if(pro_dir=="I")
	{
		switch(pro_file)
		{   case "ID_BarcodeFonts.htm":                     n=34 ; break;
			case "ID_BarcodeComponents.htm":     		    n=35 ; break;
			case "ID_BarcodePrinters.htm":            		n=36 ; break;
			case "ID_LabelSoftware.htm":     				n=37 ; break;
			case "ID_ScannersWands.htm":     			    n=38 ; break;
			case "ID_RFIDProducts.htm": 			        n=39 ; break;
		}
	

		try
	    {
		for (i=34; i<=39 ; i++)
			{   
		
				var tdname  = "td"+i;
				
				var tdn = document.getElementById(tdname);
		
				if (i!=n)
					tdn.style.backgroundColor = "";
				else
					tdn.style.backgroundColor = "#aaaaaa";
			}
		} catch (err)
	    {}

	}
}


function  RequestString(vPar)
{
	
	var pos,str,para,parastr,tempstr1;
	tempstr="";
	str = window.location.href;
	
	pos = str.indexOf("?")
	parastr = str.substring(pos+1);
	//document.write("<br>????:"+str);
	//alert("***"+str+"\n"+pos+"\n"+parastr);
	if (pos>0)
	{
	 //document.write("<br>????:"+parastr);
	 if (str.indexOf("&")>0)
		{
			para = parastr.split("&");
			for(i=0;i<para.length;i++)
			{
				tempstr1 = para[i];
 				SUBpos = tempstr1.indexOf("=");
	 			 //document.write (tempstr1.substring(0,pos));
	  			//document.write ("<br>??"+i+":"+tempstr1.substring(0,pos));
				//document.write ("??:"+tempstr1.substring(pos+1));
				if (vPar==tempstr1.substring(0,SUBpos))
					return tempstr1.substring(SUBpos+1,tempstr1);
			}
	 }
	 else
	 {
		 
		 SUBpos = parastr.indexOf("=");
		 //alert(SUBpos+"\n"+vPar+"\n"+parastr.substring(0,SUBpos));
		 if (vPar==parastr.substring(0,SUBpos))
					return parastr.substring(SUBpos+1,parastr.length);

		
		 
	 }


	  
	}
	else 
 	{
		//document.write ("???");
		return null
 	}


}