		
		function findPosY(obj){
			obj=document.getElementById(obj);
			var curtop = 0;
			if (obj.offsetParent){
				while (obj.offsetParent){
					curtop += obj.offsetTop
					obj = obj.offsetParent;
				}
			}
			else if (obj.y)
			curtop += obj.y;
			return curtop;
		}
		function findPosX(obj){
			obj=document.getElementById(obj);
			var curleft = 0;
			if (obj.offsetParent){
				while (obj.offsetParent){
					curleft += obj.offsetLeft
					obj = obj.offsetParent;
				}
			}else if (obj.x)
			curleft += obj.x;
			return curleft;
		}
            function populatediv(urlval,divval){

populate(urlval,divval,'');
}
function populate(urlval,divval,loading){
try{
var xmlhttp=false;
var status=0;
if(loading != 'no'){			
var str_temp = '<div style="padding-left:100px;font-size:12px;font-weight:bold;"><br/><br/><br/>Loading<img border="0" src="/photo.cms?msid=1748421" hspace="5"><br/><br/></div>';
str_temp = str_temp + '';
document.getElementById(divval).innerHTML = str_temp;}
xmlhttp = window.XMLHttpRequest?new XMLHttpRequest():new ActiveXObject("Microsoft.XMLHTTP");
if (xmlhttp){	
xmlhttp.onreadystatechange=function(){
if (xmlhttp.readyState==4){
if (xmlhttp.status==200){	
document.getElementById(divval).innerHTML=xmlhttp.responseText;

}
else if (xmlhttp.status==404) status=0
else status=0}}
xmlhttp.open("GET",urlval,true);
xmlhttp.send(null);
}}catch (e){xmlhttp = false; }}   
function setHomepage1(what, url)

							{										



							if (navigator.appName == 'Microsoft Internet Explorer' && document.getElementById)  

							setHomepageExplorer(what, url);

							else if (document.layers || document.getElementById) setHomepageNetscape(what, url);

							return false;

							}



						function setHomepageNetscape(what, url) 

						{

						var warn = '';

						if (confirm(warn)) 

						{

							netscape.security.PrivilegeManager.enablePrivilege("UniversalPreferencesWrite");

							navigator.preference('browser.startup.homepage', url);netscape.security.PrivilegeManager.disablePrivilege("UniversalPreferencesWrite");

						}

						}



						function setHomepageExplorer(what, url)

						{

							what.style.behavior = 'url(#default#homepage)';

							what.setHomePage(url);

						}

function NBSlider(id,t,w,h){
		this._lockEvt=false;
		this.slideImgNo=1;
		this.cntr = document.getElementById(id);
		this.cntr1wdth=w;
		this.cntr1hght=h;	
		this.curleft=0;
		this.curtop=0;
		this.intrvl=null;
		this.cursld=1;	
		this.totsld=t;
		this.imgn="simg";
		this.lb="lb";
		this.rb="rb";
		this.startSlide=function(d,sobj){		
			if(this._lockEvt){return;}
			if(d=="left"){
				if(this.cursld==this.totsld){return;}
				this.curleft = parseInt(this.cntr.style.left.substring(0,this.cntr.style.left.length-2))-(this.cntr1wdth*this.slideImgNo);			
				this.cursld++;
				this.intrvl=setInterval(sobj+".move('"+d+"')",1);
				if(this.cursld < this.totsld){			
				var simg = document.getElementById(this.imgn+(this.cursld+1));
					if(!(simg.getAttribute("imgpath")=='' || simg.getAttribute("imgpath")==null)){simg.src=simg.getAttribute("imgpath");simg.setAttribute("imgpath","")}
				}
			}else if(d=="right"){
				if(this.cursld==1)return;						
				this.curleft = parseInt(this.cntr.style.left.substring(0,this.cntr.style.left.length-2))+(this.cntr1wdth*this.slideImgNo);
				this.cursld--;			
				this.intrvl=setInterval(sobj+".move('"+d+"')",1);
			}
			else if(d=="up"){
				if(this.cursld==this.totsld){return;}
				this.curtop = parseInt(this.cntr.style.top.substring(0,this.cntr.style.top.length-2))-(this.cntr1hght*this.slideImgNo);			
				this.cursld++;
				this.intrvl=setInterval(sobj+".move('"+d+"')",1);
				if(this.cursld < this.totsld){			
				var simg = document.getElementById(this.imgn+(this.cursld+1));
					if(!(simg.getAttribute("imgpath")=='' || simg.getAttribute("imgpath")==null)){simg.src=simg.getAttribute("imgpath");simg.setAttribute("imgpath","")}
				}
			}else if(d=="down"){
				if(this.cursld==1)return;						
				this.curtop = parseInt(this.cntr.style.top.substring(0,this.cntr.style.top.length-2))+(this.cntr1hght*this.slideImgNo);
				this.cursld--;			
				this.intrvl=setInterval(sobj+".move('"+d+"')",1);
			}
		};
		this.mngbtn=function(){		
			if(this.cursld==1){document.getElementById(this.lb).className=document.getElementById(this.lb).className+"off";}		
			if(this.cursld==this.totsld){document.getElementById(this.rb).className=document.getElementById(this.rb).className+"off";}
			if(this.cursld > 1 && this.cursld < this.totsld){			
			document.getElementById(this.lb).className=document.getElementById(this.lb).className.replace("off","");
			document.getElementById(this.rb).className=document.getElementById(this.rb).className.replace("off","");}
 
		};
		this.move=function(d){
			this._lockEvt = true;
			if(d=="left"){
				if(parseInt(this.cntr.style.left.substring(0,this.cntr.style.left.length-2))<=this.curleft){
					this.cntr.style.left=this.curleft+"px";
					clearInterval(this.intrvl);this.mngbtn();
					this._lockEvt=false;
				}else{				
					this.cntr.style.left = parseInt(this.cntr.style.left.substring(0,this.cntr.style.left.length-2))-5+"px";

				}
			}else if(d=="right"){
				if(parseInt(this.cntr.style.left.substring(0,this.cntr.style.left.length-2))>=this.curleft){
					this.cntr.style.left=this.curleft+"px";
					clearInterval(this.intrvl);this.mngbtn();				
					this._lockEvt=false;
				}else{
					this.cntr.style.left = parseInt(this.cntr.style.left.substring(0,this.cntr.style.left.length-2))+5+"px";
				}
			}
			else if(d=="up"){
				if(parseInt(this.cntr.style.top.substring(0,this.cntr.style.top.length-2))<=this.curtop){
					this.cntr.style.top=this.curtop+"px";
					clearInterval(this.intrvl);this.mngbtn();
					this._lockEvt=false;
				}else{
					this.cntr.style.top = parseInt(this.cntr.style.top.substring(0,this.cntr.style.top.length-2))-5+"px";
				}
			}else if(d=="down"){
				if(parseInt(this.cntr.style.top.substring(0,this.cntr.style.top.length-2))>=this.curtop){
					this.cntr.style.top=this.curtop+"px";
					clearInterval(this.intrvl);this.mngbtn();				
					this._lockEvt=false;
				}else{
					this.cntr.style.top = parseInt(this.cntr.style.top.substring(0,this.cntr.style.top.length-2))+5+"px";
				}
			}	
		
		};
		this.setBtn=function(l,r){this.lb=l;this.rb=r;};			
	}
function setImgPath(imgId,sId){						
						document.getElementById("bigimg").src="/photo/"+imgId+".cms";
						}
					function setpath(imgId,sId){
									
						document.getElementById("bigimgurl").href="/iplphoto/"+imgId+".cms";
						}
						function setimgstry(x){	
								tempoo = x;
						document.getElementById("bigimgstry").innerHTML=tempoo;
;
						}
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.startSlide=function(d,o){if(this.l){return;}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(d=='l')return this.getCP(d)-5;else return this.getCP(d)+5;};
		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'");}};	
	}
function switchtabcomm(act){

try {

var arrayofTab = act.split('#');

var arrlen = arrayofTab.length-1;



for(i=arrlen;i>=0;i--)

{if(i == 0){



document.getElementById(arrayofTab[i]+"Data").style.visibility='visible';

document.getElementById(arrayofTab[i]+"Data").style.display='inline';

document.getElementById(arrayofTab[i]).className="current";

}else {

document.getElementById(arrayofTab[i]+"Data").style.visibility='hidden';

document.getElementById(arrayofTab[i]+"Data").style.display='none';

document.getElementById(arrayofTab[i]).className="";}}

}

catch(ex){

}

}

function loadi(io){					
						var im = document.getElementById(io);
						if(!(im.getAttribute("imgpath")=='' || im.getAttribute("imgpath")==null)){
							im.src=im.getAttribute("imgpath");
							im.setAttribute("imgpath","");
						}
					}
function switchtabcomm1(act,type){
var arrayofTab = act.split('#');
var arrlen = arrayofTab.length-1;
for(i=arrlen;i>=0;i--){
if(i == 0){
if(type==1){
document.getElementById(arrayofTab[i]+"Data").style.visibility='visible';
document.getElementById(arrayofTab[i]+"Data").style.display='inline';}
document.getElementById(arrayofTab[i]).className="current";
}else {
if(type==1){document.getElementById(arrayofTab[i]+"Data").style.visibility='hidden';
document.getElementById(arrayofTab[i]+"Data").style.display='none';}
document.getElementById(arrayofTab[i]).className="";
}}}function openSelect(obj){
	inputs = document.getElementById("srchcmb1");	
		active = document.getElementById("srchsel");			
		if(obj=='srchcmb1'){
if(inputs.style.display=="block")
{
	inputs.style.display="none";
	inputs.style.visibility="hidden";	
}
else
{
	inputs.style.display="block";	
	inputs.style.visibility="visible";	
}
		}else{
			textnode = document.getElementById(obj).innerHTML;
			active.innerHTML=textnode;
			inputs.style.display="none";
			inputs.style.visibility="hidden";
			document.frmsearch1.search1.value=obj;
			
			}

}
function implementsearch1(){
var searchtext=document.frmsearch1.query.value;
var x=-1;
x=document.frmsearch1.search1.value;
if(x==0){
var strsearch = "/iplmarginbywickets.cms";
document.frmsearch1.action=strsearch;
document.frmsearch1.submit();
} 
else if(x==1){
var strsearch = "/iplteamhistory.cms";
document.frmsearch1.action=strsearch;
document.frmsearch1.submit();
}else if(x==2){
var strsearch = "/ipltopinhs.cms";
document.frmsearch1.action=strsearch;
document.frmsearch1.submit();
}
else if(x==3){
var strsearch = "/iplmarginbyruns.cms";
document.frmsearch1.action=strsearch;
document.frmsearch1.submit();
}
else if(x==4){
var strsearch = "/iplmarginbywickets.cms";
document.frmsearch1.action=strsearch;
document.frmsearch1.submit();
}
else if(x==5){
var strsearch = "/iplteamstanding.cms";
document.frmsearch1.action=strsearch;
document.frmsearch1.submit();
}
else if(x==6){
var strsearch = "/ipltopbatfours.cms";
document.frmsearch1.action=strsearch;
document.frmsearch1.submit();
}
else if(x==7){
var strsearch = "/ipltopbatfifty.cms";
document.frmsearch1.action=strsearch;
document.frmsearch1.submit();
}
else if(x==8){
var strsearch = "/iplteammostfours.cms";
document.frmsearch1.action=strsearch;
document.frmsearch1.submit();
}
else if(x==9){
var strsearch = "/ipltopbatavg.cms";
document.frmsearch1.action=strsearch;
document.frmsearch1.submit();
}
else if(x==10){
var strsearch = "/ipltopbaths.cms";
document.frmsearch1.action=strsearch;
document.frmsearch1.submit();
}
else if(x==11){
var strsearch = "/ipltophundred.cms";
document.frmsearch1.action=strsearch;
document.frmsearch1.submit();
}
else if(x==12){
var strsearch = "/ipltopbatruns.cms";
document.frmsearch1.action=strsearch;
document.frmsearch1.submit();
}
else if(x==13){
var strsearch = "/ipltopballavg.cms";
document.frmsearch1.action=strsearch;
document.frmsearch1.submit();
}
else if(x==14){
var strsearch = "/ipltopbowlfig.cms";
document.frmsearch1.action=strsearch;
document.frmsearch1.submit();
}
else if(x==15){
var strsearch = "/ipltopfvwkts.cms";
document.frmsearch1.action=strsearch;
document.frmsearch1.submit();
}
else if(x==16){
var strsearch = "/ipltopbwlwkts.cms";
document.frmsearch1.action=strsearch;
document.frmsearch1.submit();
}
else if(x==17){
var strsearch = "/ipltophwbwlwkts.cms";
document.frmsearch1.action=strsearch;
document.frmsearch1.submit();
}
else if(x==18){
var strsearch = "/ipltopcaphs.cms";
document.frmsearch1.action=strsearch;
document.frmsearch1.submit();
}
else if(x==19){
var strsearch = "/ipltopfddis.cms";
document.frmsearch1.action=strsearch;
document.frmsearch1.submit();
}
else if(x==20){
var strsearch = "/ipltopkpdis.cms";
document.frmsearch1.action=strsearch;
document.frmsearch1.submit();
}}
function valid(){
	if(document.frmsearch1.query.value==""){
		alert("Please enter text to search");
		return false;
		}		
		else {
		implementsearch1();
		return true;
		}
	}
function showTab(tabsid,cls,ths){
var allTabsid = tabsid.split("#");
var classname = cls.split("#");
for(tid = 0; tid < allTabsid.length; tid++){
	if(ths == allTabsid[tid]){
		getObj(allTabsid[tid]).className=''+classname[0];
		getObj(allTabsid[tid] + 'cnt').style.display='inline-block';
	}else{
		getObj(allTabsid[tid]).className=''+classname[1];
		getObj(allTabsid[tid] + 'cnt').style.display='none';
	}
}
return false;
}
function getObj(id){return document.getElementById(""+id);}	

 