// JavaScript Document

//TRY TO OPEN MUSIC PLAYER
function popup(mylink, windowname) {
	var musicStatus = getCookie("musicStatus");
	if (musicStatus!=undefined) {
		setCookie("musicStatus", musicStatus, 1);
	} else {
		if (! window.focus) {
			return true;
		}
		mywindow = window.open('/flash/mp3Player.html','1313812505584','width=150,height=50,toolbar=0,menubar=0,location=0,status=0,scrollbars=0,resizable=0,left=0,top=0');
		if ( mywindow != undefined ) {
			mywindow.moveTo(window.screenX, window.screenY);
			mywindow.moveTo(window.screenLeft, window.screenTop);
			mywindow.blur();
			setCookie("musicStatus", "play", 1);
		}
	}
	return false;
}

//SET COOKIE
function setCookie(c_name,value,exdays) {
	var exdate = new Date();
	
	var exdate = new Date();
	
	if (exdays == -1) {
		exdate.setDate(exdate.getDate() + exdays);
	} else {
		exdate.setTime(exdate.getTime() + (5 * 60 * 1000)); 
	}
	

	var c_value = escape(value) + ((exdays==null) ? "" : "; expires=" + exdate.toUTCString() + '; path=/');
	document.cookie = c_name + "=" + c_value;
}

//GET COOKIE
function getCookie(c_name) {
	var i,x,y,ARRcookies=document.cookie.split(";");
	for (i=0;i<ARRcookies.length;i++) {
		x=ARRcookies[i].substr(0,ARRcookies[i].indexOf("="));
		y=ARRcookies[i].substr(ARRcookies[i].indexOf("=")+1);
		x=x.replace(/^\s+|\s+$/g,"");
		if (x==c_name) {
			return unescape(y);
		}
	}
}
