// Barcelonaconnect Scripts
// Copyright (C) 2002 GoAndConnect Ltd
var showrequired=true;
var formcomplete = false;
var t;
var site_root = "/";
var siteid = 1
var langid = 1;
var N = (document.all) ? 0 : 1;					
var ob;
var BtnY = new Array();
var Pid = new Array();
var PName = new Array();	function checkMSIE(ver){			var useragent = navigator.userAgent;
		var pos = useragent.indexOf('MSIE');
		var bVer = 0
		if (pos > -1) {
			bVer = useragent.substring(pos + 5);
			var pos = bVer.indexOf(';');
			bVer = bVer.substring(0,pos);
		}
		if ((pos > -1) && (bVer >= ver))			return true		else			return false	}

	function swaplogo(imgsrc){
		document.logoimg.src=imgsrc
	}

	function swapsectionlogo(imgsrc){
		document.sectionlogo.src=imgsrc
	}

	function showpic(url,height,width){
		var mywindow,props,scroll;
		if(height>500){
			scroll="yes"
			width=width+10
			}
		else
			scroll="no"
			
		props='width=' + width + ', height=' + height +', resizable=yes, scrollbars='+scroll
		
		mywindow = window.open(url,'pic',props);
		mywindow.resizeTo(width,height);
		mywindow.focus();				
	}

	function popup(url,name,specs){
		var mywindow;
		mywindow = window.open(url,name,specs);
		mywindow.focus();		
	}
	function gourl(pid){
		var d,mainlink
		d = new Date();		
		mainlink="showlevel1.asp?pid=" + pid;
		window.location=mainlink
	}

	function changetbcolor(cell){

		if (cell.bgColor=="#d0d0ff") {
			cell.bgColor="#ff9900"
			}
		else{
			if (cell.bgColor=="#c9c9ff"){
				cell.bgColor="#ff3300"
				}
			else{
				if (cell.bgColor=="#ff9900"){
					cell.bgColor="#d0d0ff"
					}
				else{
					if (cell.bgColor=="#ff3300") 
						cell.bgColor="#c9c9ff"
				}
			}
		}
	}

	function TableRowShowDiv(divid){
	var element;	
	clearTimeout(t);
		for (element in document.getElementsByTagName("DIV")){
			if (element.indexOf('_'+divid.toString()+'_')>=0){							
				document.getElementById(element).style.overflowY='visible';															
			}
		}
		for (element in document.getElementsByTagName("TD")){
			if (element.indexOf('_'+divid.toString()+'_')>=0){
				document.getElementById(element).style.background='#99FF99'
			}						
		}
	}	

	function TableRowHighlight(divid){
	var element;	
	clearTimeout(t);
		for (element in document.getElementsByTagName("TD")){
			if (element.indexOf('_'+divid.toString()+'_')>=0){			
				document.getElementById(element).style.background='#99FF99'
			}						
		}		
		t=setTimeout("TableRowExpand("+divid+")",500)
	}
	
	function TableRowExpand(divid){
	var element;
		for (element in document.getElementsByTagName("DIV")){
			if (element.indexOf('_'+divid.toString()+'_')>=0){						
				document.getElementById(element).style.overflowY='visible';
			}
		}

	}	

	function TableRowHideDiv(divid,divcolor){
	
	var element;
	clearTimeout(t);
		for (element in document.getElementsByTagName("TD")){
			if (element.indexOf('_'+divid.toString()+'_')>=0){
				document.getElementById(element).style.background=divcolor						
			}		
		}
	}	

	function swapimg(img){
		var index = img.src.indexOf('yell');
		if (index > 0)
			img.src=img.src.substring(0,index-1)+'.gif'
		else
			img.src=img.src.substring(0,img.src.length - 4)+'_yell.gif'	
	}

	function submitSearch(){
		top.location=document.all("siterootsearch").value + "search.asp?langId="+document.all("langidsearch").value+"&pid="+document.all("pidsearch").value+"&action=All&text=" + escape(document.all("TopNavSearchTextBox").value)
	}
	
function checkTOS(){
	var isMac;
	isMac = (navigator.appVersion.indexOf("Mac")!=-1) ? true : false;
	if (isMac)
		document.forms[0].submit()
	else{
		checktext()		
		if (document.getElementById("TOS").checked) 
			if (document.getElementById("ValidationMsg").style.visibility!="hidden")
				alert("please fill in all required information")						
			else
				document.loginform.submit()
		else
			alert("you must agree to the Terms of Services before registering")
	}
}
function createtimestamp(finput){
	var d;
	d = new Date();
	document.getElementById("timestamp").value= d.getTime();
	document.getElementById(finput).focus()
}
function checkPasswords(val){
	if (document.getElementById("password1").value==val){
		document.getElementById("Requiredpassword1").style.visibility="hidden"
		document.getElementById("Requiredpassword2").style.visibility="hidden"		
	}
	else{
		document.getElementById("Requiredpassword1").style.visibility="visible"
		document.getElementById("Requiredpassword2").style.visibility="visible"
		document.getElementById("Requiredpassword2").innerHTML="<font color=red>Passwords don't match</font>"
		
	}
}		
