userAgent = window.navigator.userAgent;
browserVers = parseInt(userAgent.charAt(userAgent.indexOf("/")+1),10);
function change_block(block) {
	document.getElementById('flash').style.display = "none";
	document.getElementById(block).style.display = "block";
}
function setCookie(num) {
	var expireDate = new Date();
	expireDate.setDate(365 + expireDate.getDate());
	document.cookie = "zsound=" + num + "; expires=" + expireDate.toGMTString() + ";";
}
function getCookie() {
	var arg = "zsound="; 
	var alen = arg.length; 
	var clen = document.cookie.length;
	if (clen > 0) {
		var i = 0; 
		while (i < clen) { 
			var j = i + alen; 
			if (document.cookie.substring(i, j) == arg) return getCookieVal(j); 
			i = document.cookie.indexOf(" ", i) + 1; 
			if (i == 0) break; 
		}
	} else {
		setCookie(1);
		callFlash();
	}
	return null;
}
function getCookieVal(offset) { 
	var endstr = document.cookie.indexOf (";", offset); 
	if (endstr == -1) endstr = document.cookie.length;
	return unescape (document.cookie.substring(offset, endstr)); 
}
function checkCookie() {
	if (getCookie() == 1) setTimeout('callFlash()', 1000);
}
function callFlash() {
	var IE = navigator.appName.indexOf("Microsoft") !=-1;
	var flashObj = IE ? document.sound : document.getElementById('sound_');
	flashObj.GotoFrame(1);
	flashObj.Play();
}
function openWin(url,w,h)	{
	var str = "";
	str += "height=" + h + ",innerHeight=" + h;
 	str += ",width=" + w + ",innerWidth=" + w;
  	if (window.screen) {		
   		var ah = screen.availHeight - 30;
    	var aw = screen.availWidth - 10;

	   	var xc = (aw - w) / 2;
    	var yc = (ah - h) / 2;

	    str += ",left=" + xc + ",screenX=" + xc;
    	str += ",top=" + yc + ",screenY=" + yc;
	}
	winParams = str + ',status=0,directories=0,location=0,menubar=0,toolbar=0,resizable=0,scrollbars=yes';
	
	var theWindow = window.open(url,'openWin',winParams);
	if (theWindow)	{ theWindow.focus(); }
}
