// common.js
function stringsEquals(s1,s2){

if(s1.length!=s2.length) return false;

for(sl=0;sl<s1.length;sl++){

if(s1.charAt(sl)!=s2.charAt(sl)) return false;
}
return true;
}
function getRelativePath(){
locationVal = window.location;
ind = locationVal.toString().lastIndexOf("/");
return locationVal.toString().substring(ind);
}
function getHostAndContextPath(){
locationVal = window.location;
ind = locationVal.toString().lastIndexOf("/");
return locationVal.toString().substring(0,ind);
}
function gotoProline(){
if(getRelativePath()=="/prolineEvents.do")
return;

window.location=getHostAndContextPath()+"/prolineEvents.do";
}
function gotoPointSpread(){

if(getRelativePath()=="/pointspreadEvents.do")
return;

window.location=getHostAndContextPath()+"/pointspreadEvents.do";
}
function gotoPropicks(){

if(getRelativePath()=="/propicksCards.do")
return;

window.location=getHostAndContextPath()+"/propicksCards.do";
}
function switchLanguage1(){
	if(document.forms[0].name=="picksMenuForm"){
		document.forms[1].language.value="switchLanguage";
 		return document.forms[1].submit();
 	}else{
 		document.forms[0].language.value="switchLanguage";
 		return document.forms[0].submit();
 	}
}
function switchLanguage(langValue){
	//alert(langValue);
	var s = "/changeLanguage.do?language="+langValue;	
	document.location.href=s;
}

function submit(language ){
	document.forms["languageForm"].language.value=language;
	return document.forms["languageForm"].submit();
}

function onmouseoverPointspread(){
writetxt("Point Spread");
document.all.td2.background ="images/pointspread/btn_pointspread_off.gif";
}
function onmouseoverActivePointspread(){
writetxt("Point Spread");
}
function onmouseoutPointspread(){
writetxt(0);
document.all.td2.background ="images/pointspread/btn_pointspread_on.gif";
}
function onmouseoverProline(){
writetxt("Proline");
document.all.td1.background ="images/proline/btn_proline_off.gif";
}
function onmouseoverActiveProline(){
writetxt("Proline");
}
function onmouseoutProline(){
writetxt(0);
document.all.td1.background ="images/proline/btn_proline_on.gif";
}

function onmouseoverPropicks(){
writetxt("Propicks");
document.all.td3.background ="images/propicks/btn_propicks_off.gif";
}
function onmouseoverActivePropicks(){
writetxt("Propicks");
}
function onmouseoutPropicks(){
writetxt(0);
document.all.td3.background ="images/propicks/btn_propicks_on.gif";
}
function getObj(name)
{
  if (document.getElementById)
  {
  	this.obj = document.getElementById(name);
	this.style = document.getElementById(name).style;
  }
  else if (document.all)
  {
	this.obj = document.all[name];
	this.style = document.all[name].style;
  }
  else if (document.layers)
  {
   	this.obj = document.layers[name];
   	this.style = document.layers[name];
  }
}
window.onload=function(){
  navtxt=(NS4)? document.layers['navtxt'] : (IE4)? document.all['navtxt'] : (W3C)? document.getElementById('navtxt') : null;
  if(navtxt==null) return;
  getboxwidth();
  getboxheight();
  getwindowdims();
  isloaded=true;
  if((W3C || IE4) && centertext)navtxt.style.textAlign="center";
  if(W3C)navtxt.style.padding='4px';
  if(IE4 || IE5 && dofade)navtxt.style.filter="alpha(opacity=0)";
  moveDivToRow();
  }
function isNumber(arg){
  for(i=0;i<arg.length;i++)
		if(arg.charAt(i)>=0||arg.charAt(i)<=9)
			continue;
		else
			return false;
  return true;
}
