function popup_movie(m,w,h,mw,mh) {
	pw = window.open('pop_movie.php?m='+m+'&mw='+mw+'&mh='+mh, 'pop_movie', 'menubar=no, toolbar=no, resizable=yes, scrollbars=yes, status=no, width='+w+', height='+h);
	pw.focus();
}

function popup_image(i,w,h) {
	pw = window.open('pop_image.php?i='+i+'&w='+w+'&h='+h, 'pop_movie', 'menubar=no, toolbar=no, resizable=yes, scrollbars=yes, status=no, width='+w+', height='+h);
	pw.focus();
}

function Set_Cookie(name, value, expires, path, domain, secure) {
	// set time, it's in milliseconds
	var today = new Date();
	today.setTime(today.getTime());

	/*
	if the expires variable is set, make the correct 
	expires time, the current script below will set 
	it for x number of days, to make it for hours, 
	delete * 24, for minutes, delete * 60 * 24
	*/
	if(expires){
		expires = expires * 1000 * 60 * 60 * 24;
	}
	var expires_date = new Date(today.getTime() + (expires));
	
	document.cookie = name + "=" +escape(value) + ((expires) ? ";expires=" + expires_date.toGMTString() : "") + ((path) ? ";path=" + path : "") + ((domain) ? ";domain=" + domain : "") + ((secure) ? ";secure" : "");
}

function Get_Cookie(name) {
	var start = document.cookie.indexOf(name + "=");
	var len = start + name.length + 1;
	if((!start) && (name != document.cookie.substring(0, name.length))) {
		return null;
	}
	if(start == -1) return null;
	var end = document.cookie.indexOf(";", len);
	if(end == -1) end = document.cookie.length;
	return unescape(document.cookie.substring(len, end));
}

function Delete_Cookie(name, path, domain) {
	if(Get_Cookie(name)) 
		document.cookie = name + "=" + (( path) ? ";path=" + path : "") + ((domain) ? ";domain=" + domain : "" ) + ";expires=Thu, 01-Jan-1970 00:00:01 GMT";
}

function setFlash(id, w, h, swf, play, noflashimg, ssl) {
	ssl = (!ssl)?"http":"https";
	if ((document.implementation && document.implementation.createDocument)||(window.ActiveXObject)){
		document.getElementById(id).innerHTML = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+w+'" height="'+h+'" codebase="'+ssl+'://active.macromedia.com/flash5/cabs/swflash.cab#version=5,0,0,0"><param name="MOVIE" value="'+swf+'" /><param name="PLAY" value="true" /><param name="LOOP" value="true" /><param name=FlashVars value="paramPage='+play+'" /><param name="WMODE" value="transparent" /><param name="QUALITY" value="high" /><embed src="'+swf+'" FlashVars="paramPage='+play+'" width="'+w+'" height="'+h+'" play="true" loop="true" wmode="transparent" quality="high" pluginspage="'+ssl+'://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></embed></object>'		
	}else {
		document.getElementById(id).style.background = 'url('+noflashimg+') 0 0 no-repeat';
		document.getElementById(id).style.height = h+'px';
	}
}
