// JavaScript Document


//Set tab to intially be selected when page loads:
//[which tab (1=first tab), ID of tab content to display]:
var initialtab=[1, "mid41"]

//Turn menu into single level image tabs (completely hides 2nd level)?
var turntosingle=0 //0 for no (default), 1 for yes

var mainUL =new Array();
//Disable hyperlinks in 1st level tab images?
var disabletablinks=0 //0 for no (default), 1 for yes

////////Stop editting////////////////
var primaryLinks = new Object()
var rawLinks = Array("46","47","48","49","50","102","114") 
for( i in rawLinks){
	primaryLinks["mid" + rawLinks[i]] = 0
}

var previoustab= new Object()
previoustab.id = ""
previoustab.lid = ""
previoustab.isImageReplaced = false

if (turntosingle==1)
	document.write('<style type="text/css">\n#tabcontentcontainer{display: none;}\n</style>')

function expandcontent(cid, lid, imageReplace){
	if (document.getElementById){
		if (turntosingle==0){
			if (previoustab.id!="" && previoustab.id!=cid){
				if (document.getElementById(previoustab.id) != null){
					document.getElementById(previoustab.id).style.display="none"
				}
				if (previoustab.isImageReplaced){
					document.getElementById(previoustab.lid).style.backgroundImage=''
				}
			}
			
			if(imageReplace){
				document.getElementById(lid).style.backgroundImage= ''
			}
			if (document.getElementById(cid) != null){
				document.getElementById(cid).style.display="block"
			}
		
			var workingtab = new Object()
			workingtab.id = cid
			workingtab.lid = lid
			workingtab.isImageReplaced = imageReplace
			previoustab= workingtab
			primaryLinks[cid]++
		}
	}
}

function hidecontent(cid, lid, isImageReplaced){
	primaryLinks[cid]--
	if (primaryLinks[cid] < 0){
	   primaryLinks[cid] = 0
	}
	if (primaryLinks[cid] == 0){
		if (document.getElementById(cid) != null){
			document.getElementById(cid).style.display="none"
		}
	}
}

function highlighttab(aobject){
	if (typeof tabobjlinks=="undefined")
		collecttablinks()
	for (i=0; i<tabobjlinks.length; i++)
		tabobjlinks[i].className=""
	aobject.className="current"
}

function collecttablinks(){
	var tabobj=document.getElementById("tablist")
	tabobjlinks=tabobj.getElementsByTagName("A")
}

function do_onload(){
 //   collecttablinks()
 //Start If condition
 if (document.getElementsByTagName) // this if condition is uesed to chenge the color of listVeiw display in homepage;
 {
	 try{
		 var divName = document.getElementById('block-views-News');
	 
	
		 var liName = divName.getElementsByTagName('li');
	 } catch(e)	 {
		return;
	 }
	 //var aName = liName.getElementsByTagName('a');
	 
	 for (var i=0 ; i<liName.length; i++)
	 {
		if (i % 2 == 0)
		{
			liName[i].className = 'odd';
		//	aName[0].className ='even';
		}else{
			liName[i].className = 'even';
		//	aName[0].className ='odd';
		}
	 }
	// alert(liName);
	 
 }//End if conditions
//alert(divName.innerHTML);
 if (document.getElementById("block-block-2") != null && document.getElementById("block-block-3") != null){
	document.getElementById("block-block-2").style.display="block"
	document.getElementById("block-block-3").style.display="block"
}

//expandcontent(initialtab[1], tabobjlinks[initialtab[0]-1])
var WebFXPane = document.getElementById("tabPaneMarketBlock")
if (WebFXPane != null && WebFXPane.tabPane !=null){
	WebFXPane.tabPane.setSelectedIndex(3)
	}
WebFXPane = document.getElementById("tabPaneProductsBlock")
	if (WebFXPane != null && WebFXPane.tabPane !=null){
		WebFXPane.tabPane.setSelectedIndex(4)
	}
}

if (window.addEventListener)
	window.addEventListener("load", do_onload, false)
else if (window.attachEvent)
	window.attachEvent("onload", do_onload)
else if (document.getElementById)
	window.onload=do_onload
/*function  (){
$("div.contentToChange p.firstparagraph:hidden").slideDown("slow");
$("div.contentToChange p.firstparagraph:visible").slideUp("slow");		

}	*/	
function unpopp(){
	poppDiv=$('poppDiv');
	if(poppDiv){
		poppDiv.parentNode.removeChild(poppDiv);
		poppDiv=false;
	}
}	