// JavaScript Document

document.getElementById('lpMaxWrapper').style.visibility='hidden';


$(document).ready(function() {

document.getElementById("lpMinWrapper").style.zIndex = 9999;
	
if(window.innerHeight || window.innerWidth){	
				
		heightLpMax =  (window.innerHeight/3 )  + $(window).scrollTop();
		heightLpMin =  (window.innerHeight/1.08 )  + $(window).scrollTop();
				
				WidthLpMax=200;
			//	WidthLpMax = $("#Wrapper").innerWidth()-204 +( ($(window).innerWidth()-$("#Wrapper").innerWidth())/2 );
				//alert($("#Wrapper").innerWidth());
			
			/**********************Live Person***********************/	
				document.getElementById("lpMaxWrapper").style.top =heightLpMax+"px";
				document.getElementById("lpMinWrapper").style.left =WidthLpMax+"px";
				document.getElementById("lpMinWrapper").style.top =heightLpMin+"px";
			/*************************************************************/	
	
					
		}
		else{
				
				
				heightLpMax =  document.documentElement.clientHeight/3  + $(window).scrollTop();
				heightLpMin =  ( document.documentElement.clientHeight/1.08 )  + $(window).scrollTop();
				
				WidthLpMax=200;
			//	WidthLpMax = $("#Wrapper").innerWidth()-192 +( ($(window).innerWidth()-$("#Wrapper").innerWidth())/2 );
				
				
			/**********************Live Person***********************/	
				document.getElementById("lpMaxWrapper").style.top =heightLpMax+"px";
				document.getElementById("lpMinWrapper").style.left =WidthLpMax+"px";
				document.getElementById("lpMinWrapper").style.top =heightLpMin+"px";
			
			/*************************************************************/	

		}

		
		
	

	$(window).scroll(function(){
		if(window.innerHeight || window.innerWidth){	
				
				
				heightLpMax =  (window.innerHeight/3 )  + $(window).scrollTop();
				heightLpMin =  (window.innerHeight/1.08 )  + $(window).scrollTop();
				
				WidthLpMax=200;
			//	WidthLpMax = $("#Wrapper").innerWidth()-204+( ($(window).innerWidth()-$("#Wrapper").innerWidth())/2 );
				
				
				/**********************Live Person***********************/	
				document.getElementById("lpMaxWrapper").style.top =heightLpMax+"px";
				document.getElementById("lpMinWrapper").style.left =WidthLpMax+"px";
				document.getElementById("lpMinWrapper").style.top =heightLpMin+"px";
			
			/*************************************************************/	
			
				//$("#FloatingLayerWrapper").fadeTo("slow",0);
				//$("#FloatingLayerWrapper").fadeTo(2000,0.9);

			
		}
		else{
				
				
				heightLpMax =  document.documentElement.clientHeight/3  + $(window).scrollTop();
				heightLpMin =  ( document.documentElement.clientHeight/1.08 )  + $(window).scrollTop();
				
				WidthLpMax=200;
			//	WidthLpMax = $("#Wrapper").innerWidth()-192+( ($(window).innerWidth()-$("#Wrapper").innerWidth())/2 );
				
				
			/**********************Live Person***********************/	
				document.getElementById("lpMaxWrapper").style.top =heightLpMax+"px";
				document.getElementById("lpMinWrapper").style.left =WidthLpMax+"px";
				document.getElementById("lpMinWrapper").style.top =heightLpMin+"px";
			
			/*************************************************************/			
		
				//$("#FloatingLayerWrapper").fadeTo("slow",0);
					
				//$("#FloatingLayerWrapper").fadeTo(2000,0.9)	;
  			 		

		}	
	});
	$(window).resize(function(){
				if(window.innerHeight || window.innerWidth){	
				
				
				heightLpMax =  (window.innerHeight/3 )  + $(window).scrollTop();
				heightLpMin =  (window.innerHeight/1.08 )  + $(window).scrollTop();
				WidthLpMax=200;
		//		WidthLpMax = $("#Wrapper").innerWidth()-204+( ($(window).innerWidth()-$("#Wrapper").innerWidth())/2 );
				
				
				/**********************Live Person***********************/	
				document.getElementById("lpMaxWrapper").style.top =heightLpMax+"px";
				document.getElementById("lpMinWrapper").style.left =WidthLpMax+"px";
				document.getElementById("lpMinWrapper").style.top =heightLpMin+"px";
			
			/*************************************************************/	
			
				//$("#FloatingLayerWrapper").fadeTo("slow",0);
				//$("#FloatingLayerWrapper").fadeTo(2000,0.9);

			
		}
		else{
				
				
				heightLpMax =  document.documentElement.clientHeight/3  + $(window).scrollTop();
				heightLpMin =  ( document.documentElement.clientHeight/1.08 )  + $(window).scrollTop();
				
				WidthLpMax=200;
			//	WidthLpMax = $("#Wrapper").innerWidth()-192+( ($(window).innerWidth()-$("#Wrapper").innerWidth())/2 );
				
				
			/**********************Live Person***********************/	
				document.getElementById("lpMaxWrapper").style.top =heightLpMax+"px";
				document.getElementById("lpMinWrapper").style.left =WidthLpMax+"px";
				document.getElementById("lpMinWrapper").style.top =heightLpMin+"px";
			
			/*************************************************************/			
		
				//$("#FloatingLayerWrapper").fadeTo("slow",0);
					
				//$("#FloatingLayerWrapper").fadeTo(2000,0.9)	;
  			 		

		}	

	
	});
	
	
	


	
				 
});











//====================== Timer function==================

var mins,secs,TimerRunning,TimerID;
 TimerRunning=false;
 
 function Init() //call the Init function when u need to start the timer
 {
    mins=60;
    secs=0;
    StopTimer();
    StartTimer();
	
 }
 
 function StopTimer()
 {
    if(TimerRunning)
	//alert('its two mints');
    clearTimeout(TimerID);
    TimerRunning=false;
	//return 1;
 }
 
 function StartTimer()
 {
    TimerRunning=true;
    window.status="Time Remaining "+Pad(mins)+":"+Pad(secs);
    TimerID=self.setTimeout("StartTimer()",1000);
 
    Check();
    
    if(mins==0 && secs==0)
       StopTimer();
    
    if(secs==0)
    {
       mins--;
       secs=60;
    }
    secs--;
 
 }
 
 
 
 
 
 function Check()
 {
    if(mins==60 && secs==0){
	}
	
	else if(mins==0 && secs==0)
    {
     //alert("Your alloted time is over.");
	  document.getElementById('lpMaxWrapper').style.visibility='visible';
	
	}
 }
 
   document.getElementById('lpMaxWrapper').style.visibility='visible';
	
 
 
 
 function Pad(number) //pads the mins/secs with a 0 if its less than 10
 {
    if(number<10)
       number=0+""+number;
    return number;
 }



//======================= End ===========================





