
function initHomePageMethod()
{
        if((document.getElementById("layoutDefHomepage") || document.getElementById("layoutDefHomeTabpages")) && (document.getElementById("leftContentPane")))
		{
		   ld = (document.getElementById("leftContentPane")).getElementsByTagName('div');
		   var regexpl = /hleftContent2ndRow$/g;
		   var regexp2 = /hleftContent3rdRow$/g;

		   for (var i=0;i<ld.length ;i++)
		   {
				if(ld[i].id.match(regexpl))
				{
					initpromoheight(ld[i].id);
				}
				else if(ld[i].id.match(regexp2))
				{
					initnewpromotemplateHeight(ld[i].id);
				}
		   }
		}
		
		
		if((document.getElementById("layoutDefHomepage") || document.getElementById("layoutDefHomeTabpages")) && (document.getElementById("globalLeftContentPane")))
		{  
		  
		   ld = (document.getElementById("globalLeftContentPane")).getElementsByTagName('div');
		   var regexpl = /hleftContent2ndRow$/g;
		   var regexp2 = /hleftContent3rdRow$/g;
		   
           for (var i=0;i<ld.length ;i++)
		   {
				
				if(ld[i].id.match(regexpl))
				{
					initpromoheightFourPromo(ld[i].id);
					
				}
				else if(ld[i].id.match(regexp2))
				{
					initnewpromotemplateHeightFourPromo(ld[i].id);
					
				}
		   }
		}
        
		initTooltip();//tooltip
		showBannerInit();//Banner Home
		onLoadWebformMethod();//Webforms 
		
		
if (document.getElementsByName('pnptrackingdiv') != null){
		checkCookie();
}


//Dow Call Rel 5.0
if (document.getElementsByName('DAYOFWEEKWrapper')	!= null){
	dow();
}

 if(document.getElementById("expandwebform") != null ) {
     if(document.getElementById("expandwebform") != "undefined" && document.getElementById("expandwebform").value == "Yes" )
	{
	//alert("Going in doW");
	showDayOfWeekWrapper();
	
	}
     }
//Dow Call ends
}

attachEventListener(window, "load", initHomePageMethod, false);

/* webforms*/
function onLoadWebformMethod()
{
var divObjs=document.getElementsByTagName('DIV');
	for(var i=0;i<divObjs.length;i++)
	{
		if(divObjs[i].className=="toShowOnLoad")
		{
			divObjs[i].className="toHideOnLoad";
		}
		else if(divObjs[i].className=="toHideOnLoad")
		{
			divObjs[i].className="toShowOnLoad";
		}
	}
}
/* webforms*/


/* banner Home*/
var width=0;

function showHidden(e,inputId){
	if(!inputId)inputId = this.id;
		inputId = inputId +'';
		var numericId = inputId.replace(/[^0-9]/g,'');
		var outDiv=document.getElementById('outDiv'+numericId);
		var overDiv=document.getElementById('overDiv'+numericId);
		var BgoutDiv=document.getElementById('outBg'+numericId);
		var BgoverDiv=document.getElementById('overBg'+numericId);
		outDiv.style.display='none';
		BgoutDiv.style.display='none';
		overDiv.style.display='block';
		BgoverDiv.style.display='block';
		overDiv.onmousemove=retainShowOver;
		BgoverDiv.onmousemove=retainShowOver;
		overDiv.onmouseout=hideShowOver;
		BgoverDiv.onmouseout=hideShowOver;
 }


function hideShowOver(e,inputId){

		if(!inputId)inputId = this.id;
		inputId = inputId + '';
		var numericId = inputId.replace(/[^0-9]/g,'');
		var outDiv=document.getElementById('outDiv'+numericId);
		var overDiv=document.getElementById('overDiv'+numericId);
		var BgoutDiv=document.getElementById('outBg'+numericId);
		var BgoverDiv=document.getElementById('overBg'+numericId);
		outDiv.style.display='block';
		BgoutDiv.style.display='block';
		overDiv.style.display='none';
		BgoverDiv.style.display='none';
}

function retainShowOver(e,inputId){
			
		if(!inputId)inputId = this.id;
		inputId = inputId + '';
		var numericId = inputId.replace(/[^0-9]/g,'');
		var outDiv=document.getElementById('outDiv'+numericId);
		var overDiv=document.getElementById('overDiv'+numericId);
		var BgoutDiv=document.getElementById('outBg'+numericId);
		var BgoverDiv=document.getElementById('overBg'+numericId);
		outDiv.style.display='none';
		BgoutDiv.style.display='none';
		overDiv.style.display='block';
		BgoverDiv.style.display='block';
}



function showBannerInit(){

		var divs=document.getElementsByTagName('DIV');
		var outdivCounter = 1;
		var overdivCounter=1;
		var counter=0;
		var overcounter=0;
		for(var no=0;no<divs.length;no++){
			if(divs[no].className=='outDiv'){
			divs[no].onmouseover = showHidden;
			// divs[no].onmouseout = hide;   
			divs[no].id = 'outDiv'+outdivCounter;
			divs[no].style.display='block';
			counter++;
			outdivCounter++;
			}
			if(divs[no].className==('overDiv'+overdivCounter)){
			divs[no].id = 'overDiv'+overdivCounter;
			overcounter++;
			divs[no].className='overDiv';
			divs[no].style.display='none';
			var bg = divs[no].nextSibling;
			while(bg && bg.tagName!='DIV'){
			    bg = bg.nextSibling;
			}
			bg.id='overBg'+overdivCounter;
			bg.className='overBg';
			bg.style.display='none';
			overdivCounter++;
		    }
	    }
		width=666/counter;
		var divs=document.getElementsByTagName('DIV');
		var divCounter=1;
		leftValue=0;
		for(var no=0;no<divs.length;no++){
					if(divs[no].className=='outDiv'){
					divs[no].style.left=leftValue+'px';
					divs[no].style.width=width-10+'px';
					var bg = divs[no].nextSibling;
					while(bg && bg.tagName!='DIV'){
					     bg = bg.nextSibling;
					}
					bg.id='outBg'+divCounter;
					bg.style.display='block';
					bg.style.left=leftValue+'px';
					bg.style.width=width-1+'px';
					divCounter++;
					leftValue=leftValue+width;
				}
		}
		var divs=document.getElementsByTagName('DIV');
		var val=0;
		var overValue=0;
		for(var no=0;no<divs.length;no++){
				if(divs[no].className=='overBg'){
						divs[no].style.left=val+'px';
						divs[no].style.width=width-1+'px';
						divs[no].style.display='none';
						val=val+width;
				}
				if(divs[no].className=='overDiv'){
						divs[no].style.left=overValue+'px';
						divs[no].style.width=width-10+'px';
						overValue=overValue+width;
				}
		}

}

/*Banner Home*/


// Contextual Help ---- start

var currShow = false; 
var boxHeight, cntHeight;
function setOpacity(obj, opacity) {
	  opacity = (opacity == 100)?99.999:opacity;
	  // IE/Win
	  obj.style.filter="progid:DXImageTransform.Microsoft.Alpha(opacity="+ opacity + ");";
	  // Safari<1.2, Konqueror
	  obj.style.KHTMLOpacity = opacity/100;
	  // Older Mozilla and Firefox
	  obj.style.MozOpacity = opacity/100;
	  // Safari 1.2, newer Firefox and Mozilla, CSS3
	  obj.style.opacity = opacity/100;
}

var maxTooltipHt=false;

function ShowChildFunction(inputId, numericId){
		var inputId= inputId;
		var numericId=numericId;
		currShow=numericId;	
		var x = document.getElementById("tooltipBody"+numericId);	
		//leftX = x.offsetLeft;
		//topY = x.offsetTop;	
		//alert(currShow);
		leftX = findPosX(x);
		topY = findPosY(x);
		//alert(leftX+" "+topY);
		//alert(leftX+"------"+topY);
		if(maxTooltipHt){
		//alert("showed max height before");
				var element = document.getElementById('toolTip');
				while (element.firstChild) {
				   element.removeChild(element.firstChild);
				}
				//alert(document.getElementById('toolTip').innerHTML);
				var newTooltip=document.createElement('div');
				newTooltip.id='tooltipBox';
				var parTooltip=document.getElementById('toolTip');
				parTooltip.appendChild(newTooltip);
				maxTooltipHt=false;  
		}
		if(numericId==1){
				//alert("showed max height before");
				var element = document.getElementById('toolTip');
				while (element.firstChild) {
				     element.removeChild(element.firstChild);
				}
				//alert(document.getElementById('toolTip').innerHTML);
				var newTooltip=document.createElement('div');
				newTooltip.id='tooltipBox';
				var parTooltip=document.getElementById('toolTip');
				parTooltip.appendChild(newTooltip);
				//alert(document.getElementById('tooltipBox').id);   
				// maxTooltipHt=false;  
		}
		document.getElementById('copays').style.display = "block";
		setOpacity(document.getElementById("arrow"), 98);
		//alert(document.getElementById('copays').innerHTML);
		//var delayed=setTimeout("document.getElementById('copays').style.display='none';",2000);
		//document.getElementById('tooltipBox').innerHTML = null;
		//alert("document.getElementById('tooltipBox').offSetHeight: "+document.getElementById('tooltipBox').offsetHeight);
		document.getElementById('tooltipBox').innerHTML = document.getElementById('tooltipContent'+numericId).innerHTML;
		//alert("document.getElementById('tooltipBox').offSetHeight: "+document.getElementById('tooltipBox').offsetHeight);
		//alert("document.getElementById('toolTip').offSetHeight: "+document.getElementById('toolTip').offsetHeight);
		getPosition('copays',leftX,topY,'arrow',currShow);
}
var tooltipID;
var tflag = true;

function showdiv(e,inputId){    
		boxHeight = 0;
		cntHeight = 0;
		if(!inputId)inputId = this.id;
		inputId = inputId + '';
		document.getElementById(inputId).className = 'tooltipHeadSelected';
		var numericId = inputId.replace(/[^0-9]/g,'');
		if(numericId != tooltipID)
		{
			tooltipID = numericId;
			tflag = true;
		}
		pausecomp(500);
		ShowChildFunction(inputId,numericId);
		return(false);
}

function pausecomp(millis){
		var date = new Date();
		var curDate = null;
		do { curDate = new Date(); }
		while(curDate-date < millis);
} 

function showTooltip(numId){
			var numericId=numId;
			if(numericId != tooltipID)
			{
				tooltipID = numericId;
				tflag = true;
			}
			//	alert("retain"+numericId);
			//alert("showTooltip");
			var x = document.getElementById("tooltipBody"+numericId);
			leftX = findPosX(x);
			topY = findPosY(x);
			document.getElementById('copays').style.display = "block";
			//document.getElementById('tooltipBox').innerHTML = document.getElementById('tooltipContent'+numericId).innerHTML;
			//getPosition('copays',leftX,topY,'arrow',currShow);
}


function findPosX(obj)
  {
         	var curleft = 0;
			if(obj.offsetParent)
				while(1) 
				{
				  curleft += obj.offsetLeft;
				  if(!obj.offsetParent)
					break;
				  obj = obj.offsetParent;
				}
			else if(obj.x)
				curleft += obj.x;
			return curleft;
  }

  function findPosY(obj)
  {
			var curtop = 0;
			if(obj.offsetParent)
				while(1)
				{
				  curtop += obj.offsetTop;
				  if(!obj.offsetParent)
					break;
				  obj = obj.offsetParent;
				}
			else if(obj.y)
				curtop += obj.y;
			return curtop;
  }

function getPosition(divnamePos,leftX,topY,arrowDiv, divCount){

			var screenW,screenH;
			screenW = screen.width;
			screenH = screen.height;
		    var divNumber=divCount;
			var divLeft, divTop;
			divLeft = leftX;
			divTop = topY;					
			var spaceX=screenW - divLeft;
			var spaceY=screenH - divTop;
			var positionId;
           //alert(screenW+"-----"+screenH);
           //alert("display top"+divLeft+"display top"+divTop);   
           getWindowSize();
		   var totalHt=myHeight;
		   var totalWt=myWidth;
		   //alert("pageHt"+totalHt);	  
			  var myWindowWidth = 0, myWindowHeight = 0;
			  if( typeof( window.innerWidth ) == 'number' ) {
				//Non-IE
				myWindowWidth = window.innerWidth;
				myWindowHeight = window.innerHeight;
			  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
				//IE 6+ in 'standards compliant mode'
				myWindowWidth = document.documentElement.clientWidth;
				myWindowHeight = document.documentElement.clientHeight;
			  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
				//IE 4 compatible
				myWindowWidth = document.body.clientWidth;
				myWindowHeight = document.body.clientHeight;
			  }
			//alert( 'Width = ' + myWidth );
			//alert( 'Height = ' + myHeight );
			screenW=myWindowWidth;
			screenH=myWindowHeight;	
			//alert(screenH);
		   var scrollHt=document.documentElement.scrollTop; 
		  var scrollBt=document.documentElement.scrollLeft;
		  //alert(scrollBt);
		   var visibleScreen=(scrollHt) + (screenH);
			boxHeight =  document.getElementById("tooltipBox").offsetHeight;
             var boxWidth=document.getElementById("tooltipBox").offsetHeight;			
     		var tooltipY=divTop+boxHeight + 38;
           // alert(tooltipY+"----"+visibleScreen);	
			//alert(tooltipY+"------"+visibleScreen);
			//alert("boxHeight : "+boxHeight);
			if(boxHeight >= 440){				
				cntHeight = 430;
				//alert("if loop boxHeight:"+boxHeight+"cntHeight: "+cntHeight);
				//document.getElementById("cntxtHlpInnrCnt").style.height = cntHeight;
                document.getElementById("cntxtHlpInnrCnt").style.overflow='hidden';
				//document.getElementById('copays').style.height = cntHeight;
                document.getElementById('tooltipBox').style.height='440px';
                document.getElementById('tooltipBox').style.overflow='hidden';
                maxTooltipHt=true;
			}else{
				cntHeight = boxHeight;
				//alert("else loop boxHeight:"+boxHeight+"cntHeight: "+cntHeight);
				//document.getElementById("cntxtHlpInnrCnt").style.height = boxHeight;
				//document.getElementById('copays').style.height = boxHeight;
			}
//ends here	
           var tempDiv1=document.getElementById('tooltipHead'+divNumber);
                 tempDivX1=findPosX(tempDiv1);
				 var tiplength1 = divLeft-tempDivX1;
           if(((divLeft-scrollBt)-tiplength1)> 200 && (screenW - (divLeft-scrollBt))>200 &&boxHeight<440 && (divTop-scrollHt)>(boxHeight+100)){	      
			  //alert("top");
			  var tempDiv=document.getElementById('tooltipHead'+divNumber);
                 tempDivX=findPosX(tempDiv);
				 var tiplength = divLeft-tempDivX;
				 tiplength=tiplength/2;
			  document.getElementById(divnamePos).style.left= (divLeft - 200 - tiplength) + "px";
			 
			 if(document.all){
				 
			 document.getElementById(divnamePos).style.top = (divTop - (cntHeight+25)) + "px";
			  }
			  else{
			 document.getElementById(divnamePos).style.top = (divTop - (cntHeight+25)) + "px";
			  }
			  positionId="top";
			  
		   
		 //  }

		  // if((divLeft<800) && (divTop>750)){
            /* to display top*/
			//alert("display top"+divLeft+"display top"+divTop);
			//document.getElementById(divnamePos).style.left= (divLeft - 250) + "px";
		//	document.getElementById(divnamePos).style.top = (divTop - (cntHeight+80)) + "px";
             
          
			//positionId="top";
              } else{
			     if((screenW - divLeft) > 420 ){
				 //position to the right
			  	// alert("right");
				 document.getElementById(divnamePos).style.left = (divLeft+14) + "px";	
				positionId="right";
			   	 }else{
				 //position to the left
			    // alert("left");
				 
				 var tempDiv=document.getElementById('tooltipHead'+divNumber);
                 tempDivX=findPosX(tempDiv);
				 var tiplength = divLeft-tempDivX;
				// added on 2nd Nov
				 if(((divLeft-scrollBt)-tiplength)<(screenW - (divLeft-scrollBt))){
				  document.getElementById(divnamePos).style.left = (divLeft+10) + "px";
				  positionId="right";
				 }else {
			     /* browser compatibility */
				 //alert(document.getElementById(divnamePos).id);
				 document.getElementById(divnamePos).style.left = ((divLeft-tiplength-415)) + "px";
				  positionId="left";
				 }
				 // end 2 nd Nov
		         }
			
			    if((screenH - divTop) > 500 ){
				//position to the TOP
			   //alert("bottom");
		       if(boxHeight>440){
					  var tempValue=divTop+480;   // 400 for box as we reduces the height
                      // alert(tempValue+"======"+visibleScreen);
                       if(tempValue>visibleScreen){
					  
					      var tempHeight=tempValue-visibleScreen;
				          document.getElementById(divnamePos).style.top = (divTop - (tempHeight-20)) + "px";
					      }else{
		                        var tempHeight=tooltipY-visibleScreen;
				                document.getElementById(divnamePos).style.top = (divTop - 20) + "px";
					           } 
							   
				  }		   
					else{
                           
						if(tooltipY>visibleScreen){
						var tempHeight=tooltipY-visibleScreen;
						document.getElementById(divnamePos).style.top = (divTop- (tempHeight-20)) + "px";
						
						}else {
                           
						document.getElementById(divnamePos).style.top = (divTop - 20) + "px"; 
						
						}
				
			        }

				//document.getElementById(divnamePos).style.top = (divTop - 200) + "px";
				//document.getElementById(arrowDiv).style.top = 200 + "px";
			    }else{
				//position to the Bottom
				//document.getElementById(divnamePos).style.top = '500px';
				//alert("top");
                 if(boxHeight>440){
					  var tempValue=divTop+480;   // 400 for box as we reduces the height
                       //alert(tempValue+"======"+(visibleScreen));
                       if(tempValue>(visibleScreen)){
					      
					      var tempHeight=tempValue-visibleScreen;
					
				          document.getElementById(divnamePos).style.top = (divTop - (tempHeight-20)) + "px";
					      }else{
							
		                        var tempHeight=tooltipY-visibleScreen;
				                document.getElementById(divnamePos).style.top = (divTop - 20) + "px";
					           } 
							   
				  }		   
					else{
                          
						if(tooltipY>visibleScreen){
						var tempHeight=tooltipY-visibleScreen;
					
						document.getElementById(divnamePos).style.top = (divTop- (tempHeight - 10)) + "px";
						 
						}else {
					
						document.getElementById(divnamePos).style.top = (divTop - 20) + "px"; 
						 
						}
				
			        }

				//document.getElementById(divnamePos).style.top = (divTop + 200) + "px";
			    //document.getElementById(arrowDiv).style.top = (divTop-200) + "px";
			   }
         }
		
		if(positionId=="top"){
		//alert("arrtop");
			document.getElementById(arrowDiv).style.left= 190 + "px";
			if(document.all) {
				
				document.getElementById(arrowDiv).style.top = (cntHeight+7) + "px";
				document.getElementById(arrowDiv).style.backgroundImage = 'url(/system/css/arrow.gif)'; 
				
			}
			else {
				
				document.getElementById(arrowDiv).style.top = (cntHeight+7) + "px"; 
				document.getElementById(arrowDiv).style.backgroundImage = 'url(/system/css/arrowff.gif)'; 
								
			}
			 
			document.getElementById('arrow').style.width = '27px';
			document.getElementById('arrow').style.height = '21px';			
			document.getElementById('cntxtHlpBgId').style.height= (cntHeight-10) + "px";
		
		} else if(positionId=="right"){
		//alert("right");
		
		document.getElementById(arrowDiv).style.left= -18+ "px";
		if(boxHeight>440){
					  var tempValue=divTop+440;   // 400 for box as we reduces the height
                     //  alert(tempValue+"======"+visibleScreen);
                       if(tempValue>visibleScreen){
					   //  alert("tooltip out of visible area");
					      var tempHeight=tempValue-visibleScreen;

				          document.getElementById(arrowDiv).style.top = (tempHeight + 15) + "px";
					      }else{
		                        var tempHeight=tooltipY-visibleScreen;
					
				                document.getElementById(arrowDiv).style.top = 15 + "px";
					           } 
							   
				  }		   
					else{

						if(tooltipY>visibleScreen){
						var tempHeight=tooltipY-visibleScreen;
						
                        document.getElementById(arrowDiv).style.top = (tempHeight - 15) + "px";
						
						}else {
							
						document.getElementById(arrowDiv).style.top = 15 + "px"; 
						
						}
				
			        }

		document.getElementById(arrowDiv).style.backgroundImage = "url(/system/css/arrow_lt_1.gif)"; 
		
			document.getElementById('arrow').style.width = '21px';
			document.getElementById('arrow').style.height = '27px';
        document.getElementById('cntxtHlpBgId').style.height= (cntHeight-10) + "px";
		}
		else if(positionId=="left"){
		//alert("left");
		document.getElementById(arrowDiv).style.left= 400+ "px";
		
		if(boxHeight>440){
					  var tempValue=divTop+440;   // 450 for box as we reduces the height
                      // alert(tempValue+"======"+visibleScreen);
                       if(tempValue>visibleScreen){
					     //alert("tooltip out of visible area");
					      var tempHeight=tempValue-visibleScreen;
						  //alert(tempHeight);
				            
						  document.getElementById(arrowDiv).style.top = (tempHeight +15) + "px";
					      }else{
							   
		                        var tempHeight=tooltipY-visibleScreen;
				                document.getElementById(arrowDiv).style.top = 15 + "px";
					           } 
							   
				  }		   
					else{

						if(tooltipY>visibleScreen){
						var tempHeight=tooltipY-visibleScreen;
				
                        document.getElementById(arrowDiv).style.top = (tempHeight - 15) + "px";
						
						}else {
							
						document.getElementById(arrowDiv).style.top = 15 + "px"; 
						
						}
				
			        }
		document.getElementById(arrowDiv).style.backgroundImage = "url(/system/css/arrow_rt_1.gif)";
		
			document.getElementById('arrow').style.width = '21px';
			document.getElementById('arrow').style.height = '27px'; 
		document.getElementById('cntxtHlpBgId').style.height= (cntHeight-10) + "px";
        }
		
		
		
}


function closediv()
{        
	if(tflag)
	{
	       //pausecomp(500);
            //document.getElementById('tooltipBox').display = "none";
			//document.getElementById('toolTip').display = "none";
			document.getElementById('copays').style.display = "none";
			document.getElementById('tooltipHead'+currShow).className = 'tooltipHead';
             // var delayed=setTimeout('closeChildFunction()',500); 
	}	
}
function closediv1()
{        
			tflag=true;
			document.getElementById('copays').style.display = "none";
			document.getElementById('tooltipHead'+currShow).className = 'tooltipHead';
}
function closeChildFunction(){
	if(tflag)
	{
		pausecomp(500);
		document.getElementById('tooltipHead'+currShow).className = 'tooltipHead';
		document.getElementById('copays').style.display = "none";
	}

}

function closeTooltip(closeId)
{           
	if(tflag)
	{    
			//document.getElementById('tooltipBox').display = "none";
			//document.getElementById('toolTip').display = "none";
            //var delayed=setTimeout('closeChildFunction()',500);
			document.getElementById('tooltipHead'+currShow).className = 'tooltipHead';
			document.getElementById('copays').style.display = "none";
	}
	
}
function setFlag()
{
	tflag = false;
}
function initTooltip(){

        
		var spans=document.getElementsByTagName('span');
		
		spanCounterOne=1;
        spanCounterTwo=1;
		for(var no=0;no<spans.length;no++){

            if(spans[no].className=='tooltipHead'){

               spans[no].id='tooltipHead'+spanCounterOne;
             spans[no].onmouseover=showdiv;
			  
			 var c = spans[no].getElementsByTagName("a");
			 c[0].onclick=setFlag;
			  
			  // for ddelayed result

			 /* spans[no].onmouseover= function() {
		delayhide=setTimeout('showdiv('+window.event+','+spans[no]+')',500);
		}*/
			  
			  
			  spans[no].onmouseout =closediv;
              
			   spanCounterOne++;
			}

            if(spans[no].className=='tooltipBody'){
					
               spans[no].id='tooltipBody'+spanCounterTwo;
              // spans[no].onmouseover=showdiv;
               //spans[no].onmouseout=closediv; 
			   spanCounterTwo++
			}

		}

        var divs=document.getElementsByTagName('div');
		var divCounter=1;
		for(var no=0;no<divs.length;no++){

            if(divs[no].className=='tooltipContent'){

               divs[no].id='tooltipContent'+divCounter;
               
			   divCounter++;
			}

		}

              if(document.getElementById('copays')){
        var tooltipContainer=document.getElementById('copays');
		//  tooltipContainer.onmouseover=showdiv;
		//tooltipContainer.onmouseout=closediv;
		tooltipContainer.onmouseover = function() {
		showTooltip(currShow);
		}
		tooltipContainer.onmouseout=closeTooltip;

		 //for delayed result
		/*tooltipContainer.onmouseout = function() {
		delayhide=setTimeout('closeTooltip(' + currShow + ')',8500);
		}*/
		//document.getElementById('tooltipCloseBox').onclick=closediv;
		document.getElementById('tooltipCloseBox').onclick=closediv1;
			  }
}

function getWindowSize() {
if( (typeof( window.innerWidth ) == 'number') || ( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) ) {
    //Non-IE
    myWidth = document.body.clientWidth;
    myHeight =document.body.clientHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 4 in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  }
  /*else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 6+ compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
  */
}



//Added For DOW
function dowCheck(obj)
{

	var data=obj.getElementsByTagName('INPUT')[0].value;
	if(data == "default")
		return "default";

	//var utc = dt1.getTime() + (dt1.getTimezoneOffset() * 60000);dt1 = new Date(utc + (3600000*(-5)));
	var dt2="";
	var dt1="";
	//1|01:00*21:00#3#4#5#6#7#2
	var dayData= data.split('#');
	var k="";
	var today="";
	for(var i = 0; i < dayData.length; i++){
	dt1 = new Date();
	dt2	=new Date();	
	//1|01:00*21:00
		k=dayData[i].split("|");
		today = dt1.getDay();
		if(dayData[i].length >1 && today == k[0] )	
		{
		
			var start="";
			var end="";
			dt1=dt1.getTime();
			
			for(var j = 1; j < k.length; j++)
				{	
				//01:00*21:00
				
					start = k[j].split("*")[0];
					end = k[j].split("*")[1];
					//for start and end seconds set to zero
					dt2.setSeconds("00");
					//start time set
					dt2.setHours(start.split(":")[0]);
					dt2.setMinutes((start.split(":")[1]));
					start = dt2.getTime();	
					//End Time set
					dt2.setHours(end.split(":")[0]);				
					dt2.setMinutes(end.split(":")[1]);					
					end = dt2.getTime();
			
					if(dt1<= end && dt1 >= start)
					{
						obj.style.display = "block";
						return  "success";
					}

		
		
				}			

		}
	}

	return "fail";
}

function dow()
{
	//alert("DOW");
	var data = document.getElementsByName('DAYOFWEEKWrapper');
	for (var m=0;m< data.length;m++ )
	{
		var def="";var ret="";var sett="0";var divs=data[m].getElementsByTagName('div');
		for(var i=0;i<divs.length;i++)
		{
			ret = dowCheck(divs[i]);			
			if(ret == "default")	
				def = divs[i];
			else if(ret == "success")	
				sett="1";		
			}
		if(sett != "1" && def != "")	
		{
			def.style.display="block";
		}
	
	}
	
 }


function ShowHideRepContent() {
   var harClassSelected="har_head_selected";
   var harClass="har_head";
   var hardiv=document.getElementById('contact-havearep');
  var hardivbody=document.getElementById('contact-havearep-body');

  if(hardiv.className==harClass){
            hardivbody.style.visibility='visible';  
          hardivbody.style.display='block'
         hardiv.className=harClassSelected;
        document.getElementById('contact-havearep').style.display="none";
       accordionComponent.SlideAccordionCurrentTab(10);

   } else {
          hardivbody.style.visibility='visible';  
          hardivbody.style.display='block'
          hardiv.className=harClass;
         document.getElementById('contact-havearep').style.display="none";
      accordionComponent.SlideAccordionCurrentTab(10);

   }
}

function showDayOfWeekWrapper(){
	var data = document.getElementsByName('DAYOFWEEKWrapper');
	for (var m=0;m< data.length;m++ )
	{
	if(typeof accordionComponent != "undefined")
		{
			var parentDiv=data[m].parentNode;
			var regex=/accordion_ac[0-9]/;
			var divId= "";
			while(parentDiv.tagName != "BODY")
			{			
				if(parentDiv.tagName == "DIV" && typeof parentDiv.id !=  "undefined" && parentDiv.id != "")
					{
					
						divId = parentDiv.id;
						//alert(divId);
						if(regex.test(divId))
						{
						//alert("DOW tagName=" + parentDiv.tagName);
						var compId = divId.replace("accordion_ac","");
						//alert(compId);
						accordionComponent.SlideAccordionTab(compId);
						break;
						}
					}
			
				parentDiv=parentDiv.parentNode;
			}
		}
	}
}

Array.prototype.max = function() {
var max = this[0];
var len = this.length;
for (var i = 1; i < len; i++) if (this[i] > max) max = this[i];
return max;
}
Array.prototype.min = function() {
var min = this[0];
var len = this.length;
for (var i = 1; i < len; i++) if (this[i] < min) min = this[i];
return min;
}

//added to check pnp cookie for release 6.0
function getCookie(c_name)
{
if (document.cookie.length>0)
  {
  c_start=document.cookie.indexOf(c_name + "=");
  if (c_start!=-1)
    {
    c_start=c_start + c_name.length+1;
    c_end=document.cookie.indexOf(";",c_start);
    if (c_end==-1) c_end=document.cookie.length;
    return unescape(document.cookie.substring(c_start,c_end));
    }
  }
return "";
}
//added to check pnp cookie for release 6.0
function checkCookie()
{
pnpcookie=getCookie('PnPPreFill');
if (pnpcookie!=null && pnpcookie!="")
{
	var str=pnpcookie.split("|");
	for (i=0;i<str.length ;i++)
	{
		    str1=str[i].split(":");
		    ld=document.getElementById('cookie_show_'+str1[0]);
			if(ld != null)
			{
			ld.style.display= "block";
			var previousInnerHTML = new String();
			var previousInnerHTML1 = new String();
	        previousInnerHTML = document.getElementById('cookie_show_'+str1[0]).innerHTML;
			previousInnerHTML1=previousInnerHTML.replace("##"+str1[0]+"##",str1[1]);
			document.getElementById('cookie_show_'+str1[0]).innerHTML=previousInnerHTML1;
			document.getElementById('cookie_hide_'+str1[0]).style.display ="none";
			}
	}
}
}
function globalSiteOnload()
{
console.info("inside globalSiteOnload");
if(typeof mainglobalSiteOnload == 'function') { 
   console.info("mainglobalSiteOnload");
   mainglobalSiteOnload(); 
} else{
 console.info("Global site non home page");
}
}

