// JavaScript Document
var counter = 0;
/* static function */
function incrementCounter() {
	return counter++;
}


function yourVisit(obj,skinYear) {
	
	var divBlocks = new Array();
	
	var imgStr;
	
	divBlocks[0] = "info";
	divBlocks[1] = "bike";
	divBlocks[2] = "train";
	divBlocks[3] = "underground";
	divBlocks[4] = "bus";
	divBlocks[5] = "car";
	
	for (i=0;i<divBlocks.length;i++) {
		
		
		imgStr = document.getElementById('img_'+divBlocks[i]).src;
		
		//if (imgStr.indexOf("_on.") > 0) alert(imgStr);
		
		document.getElementById('img_'+divBlocks[i]).src = '/imgs/'+skinYear+'/yourVisit/'+divBlocks[i]+'_off.gif';
	}
	document.getElementById('img_'+obj).src = '/imgs/'+skinYear+'/yourVisit/'+obj+'_on.gif';
}

function whichBrowser() {
	var browser=navigator.userAgent.toLowerCase();
	if (browser.indexOf("opera") != -1) return 'Opera';
	if (browser.indexOf("staroffice") != -1) return 'Star Office';
	if (browser.indexOf("webtv") != -1) return 'WebTV';
	if (browser.indexOf("beonex") != -1) return 'Beonex';
	if (browser.indexOf("chimera") != -1) return 'Chimera';
	if (browser.indexOf("netpositive") != -1) return 'NetPositive';
	if (browser.indexOf("phoenix") != -1) return 'Phoenix';
	if (browser.indexOf("firefox") != -1) return 'Firefox';
	if (browser.indexOf("safari") != -1) return 'Safari';
	if (browser.indexOf("skipstone") != -1) return 'SkipStone';
	if (browser.indexOf("msie") != -1) return 'Internet Explorer';
	if (browser.indexOf("netscape") != -1) return 'Netscape';
	if (browser.indexOf("mozilla/5.0") != -1) return 'Mozilla';
	if (browser.indexOf('\/') != -1) {
	if (browser.substr(0,browser.indexOf('\/')) != 'mozilla') {
	return navigator.userAgent.substr(0,browser.indexOf('\/'));}
	else return 'Netscape';} else if (browser.indexOf(' ') != -1)
	return navigator.userAgent.substr(0,browser.indexOf(' '));
	else return navigator.userAgent;
}


function toggleDiv(obj,action) {
	
	for (t=1;t<=8;t++) {
		document.getElementById("sp"+t).style.display = 'none';
	}
	
	document.getElementById(obj).style.display = 'block';
	
	/*
	var style;
	if (document.getElementById(obj).style.display == 'block') { 
		style = 'none';
	} else {
		style = 'block';
	}
	
	/*if (action == "hide") {
		//alert(whichBrowser());
		if (whichBrowser() == "Safari") style = 'none';
	}
	document.getElementById(obj).style.display = style;

	*/
}

function validateForm ( isValid ) {
	
	var theValue;
	
	if (isValid == true) {
		theValue = 1;
	} else {
		theValue = 0;
	}
	document.weatherForm.validate.value = theValue;
	//alert(document.weatherForm.validate.value);
	document.weatherForm.submit();
	
}