/************************************************
 *	    								        *
 *            ATARI JAVASCRIPT                  *
 *									            *
 ************************************************/

//Disable Right Click
/*
var message="";
function clickIE() {if (document.all) {return false;}}
function clickNS(e) {if (document.layers||(document.getElementById&&!document.all)) {
if (e.which==2||e.which==3) {return false;}}}
if (document.layers){document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}
else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;}
document.oncontextmenu=new Function("return false")
*/

//Open Popup Window
function pop(pg,id,id_screenshot){
	if(pg != undefined || pg != undefined || id != undefined) {
		var strURL;
		var attrib;
		var left = 100;
		var top = 100;
		var w;
		if (w) w.close();//close window first, if its there, in case we need to resize it...
		
		if(pg == 'friend'){ //Send to a Friend
		    strURL = "index.php?pp=friend&id=" + id;
			attrib = "width=530,height=400,scrollbars=no,resizable=yes,left=" + left + ",top=" + top + "";
		}
		else if(pg == 'screenshots'){ // Products screenshots
			if (id_screenshot != undefined) {
				strURL = "index.php?pp=screenshots&type=product&id=" + id + "&screenshotID=" + id_screenshot;
				attrib = "width=760,height=500,scrollbars=no,resizable=yes,left=" + left + ",top=" + top + "";
			}
		}
		else if(pg == 'contests'){ //Contest Pictures
		    if (id_screenshot != undefined) {
		        strURL = "index.php?pp=screenshots&type=contest&id=" + id + "&screenshotID=" + id_screenshot;
			    attrib = "width=760,height=500,scrollbars=no,resizable=yes,left=" + left + ",top=" + top + "";
			}
		}
		else if(pg == 'contests_rule'){ //Contest Rules
		    strURL = "index.php?pp=contest&id=" + id + "&show_rules";
			attrib = "width=760,height=600,scrollbars=yes,resizable=yes,left=" + left + ",top=" + top + "";
		}
		else if(pg == 'download'){ //Download
		    strURL = "index.php?pp=download&id=" + id;
			attrib = "width=760,height=400,scrollbars=yes,resizable=yes,left=" + left + ",top=" + top + "";
		}
		else if(pg == 'news'){ //News
			if (id_screenshot != undefined) {
				strURL = "index.php?pp=screenshots&type=news&&id=" + id + "&screenshotID=" + id_screenshot;
				attrib = "width=760,height=500,scrollbars=yes,resizable=yes,left=" + left + ",top=" + top + "";
			}
		}
		else{
			return false;
		}
		w = window.open(strURL,"atarifr",attrib);
		w.focus();
	}
	else{
		return false;
	}
}