// JavaScript Document

/*function showTab(sURL)
{
 window.location.href=sURL
 }*/

function ActiveTab(sTab){

			if(sTab==1){
			sPass=document.getElementById('menu_1');
			Alertbx1();
			document.getElementById('PreSales').style.display='block';
			document.getElementById('PostSales').style.display='none';
			//alert("sdfsd")
			

				}

		else if(sTab==2){
			sPass=document.getElementById('menu_2');
			Alertbx2();
			document.getElementById('PostSales').style.display='block'
			document.getElementById('PreSales').style.display='none'
			//alert("josst")
		
		}
		


}

function Alertbx1(){
	
	tds = sPass.getElementsByTagName("td");
	//alert(sPass)
	tdslength=(tds.length);
	for (var i = 0; i<tdslength; i++) {
	tds[0].className='actin1'
	tds[1].className='actin2'
	tds[2].className='actin3'
}

tds2 = document.getElementById("menu_2");
tds2tds = tds2.getElementsByTagName("td");
	tds2length=(tds2tds.length);
	for (var i = 0; i<tds2length; i++) {
	tds2tds[0].className='act1'
	tds2tds[1].className='act2'
	tds2tds[2].className='act3'
}



}
function Alertbx2(){
	
	tds = sPass.getElementsByTagName("td");
	tdslength=(tds.length);
	for (var i = 0; i<tdslength; i++) {
	tds[0].className='actin1'
	tds[1].className='actin2'
	tds[2].className='actin3'
}



tds2 = document.getElementById("menu_1");
tds2tds = tds2.getElementsByTagName("td");
	tds2length=(tds2tds.length);
	for (var i = 0; i<tds2length; i++) {
	tds2tds[0].className='act1'
	tds2tds[1].className='act2'
	tds2tds[2].className='act3'
}





}

function readCookie(name)
{
  var cookieValue = "";
  var search = name + "=";
  if(document.cookie.length > 0)
  { 
    offset = document.cookie.indexOf(search);
    if (offset != -1)
    { 
      offset += search.length;
      end = document.cookie.indexOf(";", offset);
      if (end == -1) end = document.cookie.length;
      cookieValue = unescape(document.cookie.substring(offset, end))
    }
  }
  return cookieValue;
}
// Example:
// writeCookie("myCookie", "my name", 24);
// Stores the string "my name" in the cookie "myCookie" which expires after 24 hours.
function writeCookie(name, value, hours)
{
  var expire = "";
  if(hours != null)
  {
    expire = new Date((new Date()).getTime() + hours * 3600000);
    expire = "; expires=" + expire.toGMTString();
  }
  document.cookie = name + "=" + escape(value) + expire;
}

function findObj(theObj, theDoc)
{
  var p, i, foundObj;
  
  if(!theDoc) theDoc = document;
  if( (p = theObj.indexOf("?")) > 0 && parent.frames.length)
  {
    theDoc = parent.frames[theObj.substring(p+1)].document;
    theObj = theObj.substring(0,p);
  }
  if(!(foundObj = theDoc[theObj]) && theDoc.all) foundObj = theDoc.all[theObj];
  for (i=0; !foundObj && i < theDoc.forms.length; i++) 
    foundObj = theDoc.forms[i][theObj];
  for(i=0; !foundObj && theDoc.layers && i < theDoc.layers.length; i++) 
    foundObj = findObj(theObj,theDoc.layers[i].document);
  if(!foundObj && document.getElementById) foundObj = document.getElementById(theObj);
  
  return foundObj;
}

function checkTab()
{

    if(readCookie("Tab") != '')
    {
        ActiveTab(readCookie("Tab"));
    }
    else
    {
        ActiveTab(1);
    }
}