
var _browser = navigator.appName=="Microsoft Internet Explorer"?"I":"NI";
var is_chrome=/chrome/.test(navigator.userAgent.toLowerCase());
	

		/********************************tabs show hide *****************************/
		function getObj(id){return document.getElementById(""+id);}
		function showTab(tabsid,cls,ths){	
		/* tabsid will contain all tabids with # seperation and class contain on off calss with # seperation*/
		var allTabsid = tabsid.split("#");
		var classname = cls.split("#");

		for(tid = 0; tid < allTabsid.length; tid++){
			if(ths.id == allTabsid[tid]){				
				if(_browser == "NI" && is_chrome && ths.getAttribute("crm")=="true"){
				getObj(allTabsid[tid]).className=''+classname[0]+"crm";
		
					getObj(allTabsid[tid] + 'content').style.display='inline-block'
					if(allTabsid[tid] + 'content'=='travelcontent'){
					getObj('tw').src='/alphatbslform_new.cms?type=travel';}
					if(allTabsid[tid] + 'content'=='jobscontent'){
					getObj('tj').src='/alphatbslform_new.cms?type=timesjobs';}
					if(allTabsid[tid] + 'content'=='matrimonycontent'){
					getObj('sm').src='/alphatbslform_new.cms?type=simplymarry';}
					if(allTabsid[tid] + 'content'=='propertycontent'){
					getObj('pr').src='/alphatbslform_new.cms?type=properties';}				
					if(allTabsid[tid] + 'content'=='marketcontent'){
					getObj('mkt').src='/alphaniftysensexframe.cms';}						
				}else if(_browser == "NI" && ths.getAttribute("moz")=="true"){			
					getObj(allTabsid[tid]).className=''+classname[0]+"moz";				
					getObj(allTabsid[tid] + 'content').style.display='inline-block'
					if(allTabsid[tid] + 'content'=='travelcontent'){
					getObj('tw').src='/alphatbslform_new.cms?type=travel';}
					if(allTabsid[tid] + 'content'=='jobscontent'){
					getObj('tj').src='/alphatbslform_new.cms?type=timesjobs';}
					if(allTabsid[tid] + 'content'=='matrimonycontent'){
					getObj('sm').src='/alphatbslform_new.cms?type=simplymarry';}
					if(allTabsid[tid] + 'content'=='propertycontent'){
					getObj('pr').src='/alphatbslform_new.cms?type=properties';}
					if(allTabsid[tid] + 'content'=='marketcontent'){
					getObj('mkt').src='/alphaniftysensexframe.cms';}
				}else{		
					getObj(allTabsid[tid]).className=''+classname[0];				
					getObj(allTabsid[tid] + 'content').style.display='inline-block'
					if(allTabsid[tid] + 'content'=='travelcontent'){
					getObj('tw').src='/alphatbslform_new.cms?type=travel';}
					if(allTabsid[tid] + 'content'=='jobscontent'){
					getObj('tj').src='/alphatbslform_new.cms?type=timesjobs';}
					if(allTabsid[tid] + 'content'=='matrimonycontent'){
					getObj('sm').src='/alphatbslform_new.cms?type=simplymarry';}
					if(allTabsid[tid] + 'content'=='propertycontent'){
					getObj('pr').src='/alphatbslform_new.cms?type=properties';}
					if(allTabsid[tid] + 'content'=='marketcontent'){
					getObj('mkt').src='/alphaniftysensexframe.cms';}
				}		
			}else{
				getObj(allTabsid[tid]).className=''+classname[1];
				getObj(allTabsid[tid] + 'content').style.display='none'}
		}
		return false;
		}	
		function showTab2(tabsid,cls,ths){	
		/* tabsid will contain all tabids with # seperation and class contain on off calss with # seperation*/
		var allTabsid = tabsid.split("#");
		var classname = cls.split("#");

		for(tid = 0; tid < allTabsid.length; tid++){
			if(ths.id == allTabsid[tid]){				
				if(_browser == "NI" && is_chrome && ths.getAttribute("crm")=="true"){
				getObj(allTabsid[tid]).className=''+classname[0]+"crm";
		
					
									
				}else if(_browser == "NI" && ths.getAttribute("moz")=="true"){			
					getObj(allTabsid[tid]).className=''+classname[0]+"moz";				
					
				}else{		
					getObj(allTabsid[tid]).className=''+classname[0];				
					
				}		
			}else{
				getObj(allTabsid[tid]).className=''+classname[1];
				}
		}
		return false;
		}	
		
		
		
		
		  
		
		
	 
       










function CSlider(c,t,n){
		this.c = document.getElementById(c);
		if(t!="ud")t="lr";
		this.s = (t=="lr") ? this.c.rows[0].cells[0].offsetWidth:this.c.rows[0].cells[0].offsetHeight;
		this.p = (t=="lr") ? "left" : "top";
		this.l = false;this.np = 0;this.n = n;this.intrvl=null;
		this.as=true;
		this.stct=0;
		this.astopl=false;
		this.astopr=false;
		this.tmp=1;//use for auto scroll count
		this.autointrvl=null;
		this.lnr=false;
		this.startSlide=function(d,o){if(this.l){return;}
		
		if(this.lnr){
			if(this.stct==0){
				this.stct=this.c.rows[0].cells[0].innerHTML
			}
			if((this.astopr && d=='r') || (this.astopl && d=='l'))return;			
			if(this.c.rows[0].cells[0].innerHTML=='1AM' && d=='r'){			
				var tmpvl1= document.getElementById(o+"_rb");				
				tmpvl1.className=""+tmpvl1.getAttribute("off");
				var tmpvl2= document.getElementById(o+"_lb");				
				tmpvl2.className=""+tmpvl2.getAttribute("on");
				
				this.astopr = true;
				this.astopl = false;				
			}else if(this.c.rows[0].cells[1].innerHTML==this.stct && d=='l'){			
				var tmpvl1= document.getElementById(o+"_rb");
				tmpvl1.className=""+tmpvl1.getAttribute("on");				
				var tmpvl2= document.getElementById(o+"_lb");
				tmpvl2.className=""+tmpvl2.getAttribute("off");
				this.astopl = true;
				this.astopr = false;				
			}else{			
				var tmpvl1= document.getElementById(o+"_lb");
				tmpvl1.className=tmpvl1.getAttribute("on");
				var tmpvl2= document.getElementById(o+"_rb");
				tmpvl2.className=tmpvl2.getAttribute("on");
				this.astopr = false;
				this.astopl = false;
			}			
		}
		this.l=true;if(d!='l'){this.MCir(d);}this.intrvl=setInterval(""+o+".move('"+d+"')",10);this.np = this.getNP(d);};
		this.move=function(d){
			if(this.getMv(d)){
				
				eval("this.c.style."+this.p+"=this.np+'px'");
				
				clearInterval(this.intrvl);
				
				this.l=false;
				
				if(d=='l'){
				
					this.MCir(d);
				}
			}else{
				
				eval("this.c.style."+this.p+"=this.getNCP(d)+'px'");
			}
		};		
		this.getNP=function(d){if(d=='l'){return (this.getCP()-(this.s*this.n));}else{return(this.getCP()+(this.s*this.n));}};
		this.getCP=function(d){return eval("parseInt(this.c.style."+this.p+".substring(0,this.c.style."+this.p+".length-2))");};
    	this.getMv=function(d){			
			if(d=='l' && (this.getCP(d)<= this.np))
				return true;
			else if(d=='r' && (this.getCP(d)>= this.np))
				return true;
			else return false;
		};
		this.getNCP=function(d){if(navigator.appName == "Mozilla"){if(d=='l')return this.getCP(d)-15;else return this.getCP(d)+15;}else{if(d=='l')return this.getCP(d)-10;else return this.getCP(d)+10;}};
		this.MCir = function(d){var robj = this.p=='left'?this.c.rows[0].cells:this.c.rows;for(i=0;i<this.n;i++){if(d=='l'){robj[0].parentNode.appendChild(robj[0]);}else{robj[0].parentNode.insertBefore(robj[robj.length-1],robj[0]);}}if(d=='l'){eval("this.c.style."+this.p+"=(this.getCP(d)+(this.s*this.n))+'px'");}else{eval("this.c.style."+this.p+"=(this.getCP(d)-(this.s*this.n))+'px'");}};	
//		this.autoSlide=function(d,o){
//			this.tmp++;
//			if(this.tmp>8)this.tmp=1;
//			showTab("em_dll1#em_dll2#em_dll3#em_dll4#em_dll5#em_dll6#em_dll7#em_dll8","current#notcurrent",getObj("em_dll"+this.tmp));
//			if(this.as){
//				this.startSlide(d,o);				
//			}else{
//				this.as=false;
//				clearTimeout(this.autointrvl);
//			}
//		};
		
	}

function populatediva(urlval,divval,timeid){
			try 
			{					
			var xmlhttp=false;
    		var status=0;
			xmlhttp = window.XMLHttpRequest?new XMLHttpRequest():
			new ActiveXObject("Microsoft.XMLHTTP");					
			if (xmlhttp)
				{						
				xmlhttp.onreadystatechange=function() 
				{
				if (xmlhttp.readyState==4)
				{
	 			if (xmlhttp.status==200)
		        	{ 
				getObj(divval).innerHTML=xmlhttp.responseText;
					eval(testpopu(timeid));
					}
					else if (xmlhttp.status==404) status=0 		
					else status=0
					}}
					xmlhttp.open("GET",urlval,true);
					xmlhttp.send(null);
					}}
					catch (e) 
					{
					xmlhttp = false; 
					}}


//function switchtabcommnew(act,type,timeid){
//	var arrayofTab = act.split('#');
//	var arrlen = arrayofTab.length-1;	
//	for(i=arrlen;i>=0;i--){
//	if(i == 0){
//	getObj(arrayofTab[i]).className="current";
//	populatediva("/alphaopttimesat_v2/"+timeid+".cms", 'time2timeData',timeid);
//	}else {
//	if(getObj(i).getAttribute("dis")=='dactive'){
//	getObj(i).className='disable';
//	
//	}
//	else{	
//	getObj(i).className='';
//	}
//	}
//	}
//	}
	


function TimeTab(){	
try{							   
 var i='';	   												 
 for(i=1;i<=24;i++){	
     var curid=i;										    				  
	    if(curid==curr_hour){					
         getObj(curid).className='current';        
    	 getObj(curid).style.cursor='pointer';
		 }			 				
		if(curr_hour  >= curid){								   
		getObj(i).style.cursor='pointer';			  			
     	}
		else{		
		getObj(i).className='disable';
		getObj(i).setAttribute("dis","dactive");		
		}
       }	
	  }
	  catch(ex)
	  {
	  
	  }		               
    }	
	

					
		function CSlidernew(c,t,n){
		this.c = document.getElementById(c);
		if(t!="ud")t="lr";
		this.s = (t=="lr") ? this.c.rows[0].cells[0].offsetWidth:this.c.rows[0].cells[0].offsetHeight;
		this.p = (t=="lr") ? "left" : "top";
		this.l = false;
		this.spd=15;
		this.lazy=false;
		this.ti= (t=="lr") ? this.c.rows[0].cells.length:this.c.rows[0].length;
		this.cs=1;this.np = 0;this.n = n;this.tmpn=n;this.intrvl=null;
		
		this.startSlide=function(d,o,n){									
			if(this.l){return;}
			if(this.lazy){this.lz(n,o);}
			var tmpval=0;
			if(n<this.cs){
				tmpval = this.cs-n;d='r';
			}else if(this.cs<n){
				tmpval = n-this.cs;
			}
			this.n=this.tmpn*(tmpval);
			this.cs=n;
			this.l=true;			
			this.intrvl=setInterval(""+o+".move('"+d+"','"+o+"')",this.spd);			
			this.np = this.getNP(d);
		};
		this.move=function(d,o){		
			if(this.getMv(d)){		
				eval("this.c.style."+this.p+"=this.np+'px'");		
				clearInterval(this.intrvl);		
				this.l=false;		
			}else{		
				eval("this.c.style."+this.p+"=this.getNCP(d)+'px'");
			}
		};		
		this.getNP=function(d){
			var o=(d=='l')?"-":"+";
			return eval("this.getCP()"+ o +"(this.s*this.n)");			
		};
		this.getCP=function(d){
			return eval("parseInt(this.c.style."+this.p+".substring(0,this.c.style."+this.p+".length-2))");
		};
		this.getMv=function(d){
			if(d=='l' && (this.getCP(d)<= this.np))return true;
			else if(d=='r' && (this.getCP(d)>= this.np))return true;
			else return false;
		};
		this.getNCP=function(d){
			if(d=='l')return this.getCP(d)-Math.ceil((this.getCP(d)-this.np)/this.spd);
			else return this.getCP(d)+Math.ceil((this.np-this.getCP(d))/this.spd);
		};	
		this.lz=function(x,objid){
			var upto = this.tmpn*x;
			for(i=1;i<=upto;i++){
				if(!(document.getElementById(objid+"_"+i).getAttribute("imgpath")=="" || document.getElementById(objid+"_"+i).getAttribute("imgpath")==null)){
					document.getElementById(objid+"_"+i).src=document.getElementById(objid+"_"+i).getAttribute("imgpath");
					document.getElementById(objid+"_"+i).setAttribute("imgpath","");
				}
			}
		};		
	};



	function openCloseLife(x){
	if(x==true){
		document.getElementById("life2").style.display="block";
		document.getElementById("life1").style.display="none";
		setTimeout("openCloseLife(false)",10000);
	}else{
		document.getElementById("life1").style.display="block";
		document.getElementById("life2").style.display="none";
	}
	
}


function ovr(act,xobj){
	if(act==true){
		xobj.style.cssText="background-color:#F1F1F1";
	}else{
		xobj.style.cssText="background-color:none";
	}
}
function nextSlide(obj,objid,y,z){

var tmparr;
if(obj.cs==4)
tmparr=z+"1";
else 
tmparr=z+""+(obj.cs+1);
for(i=1;i<=y;i++){
	if(i!=(obj.cs+1))
	tmparr+="#"+z+""+i;
}


switchimg(tmparr);
if(obj.cs==y){
obj.startSlide('r',objid,1);
}else{
obj.startSlide('l',objid,(obj.cs+1));
}
}
function ovr(act,xobj){
	if(act==true){
		xobj.style.cssText="background-color:#F1F1F1";
	}else{
		xobj.style.cssText="background-color:none";
	}
}