// ----------------------------------------------------------------------------------------------------------------
//new window


function getPlacementStr(w,h) {
	var left = Math.round((screen.availWidth/2)-(w/2));
	var top = Math.round((screen.availHeight/2)-(h/2));
	return (browser=="NN")?"screenX="+left+",screenY="+top:"left="+left+",top="+top;
}

function openBasicWindow(name,url,w,h,scrollbars,toolbar,statusbar,resize) {
	var placementStr = getPlacementStr(w,h);
	var x,y;
	
	// resize & scrollbar should be yes/no
	
	// set toolbar
	var tools = (toolbar=="tools")?"yes":"no";
	
	// set statusbar
	if (statusbar=="NSstatus") { 
		var status= ((browser=="NN")&&(bPlatform="Mac"))?"yes":"no";
	} else {
		var status = (statusbar=="status")?"yes":"no";
	}
	
	eval(name + "Window = window.open(url,'" + name + "', 'toolbar=" + tools + ",location=no,directories=no,status=" + status + ",scrollbars=" + scrollbars + ",resizable=" + resize + ",copyhistory=no," + placementStr + ",width=" + w + ",height=" + h + "')");                     

	// make sure window comes to the front
	eval(name + "Window.focus()");
	eval("setTimeout('"+name+"Window.focus()',50)");

	// move window to center after the fact (ie mac problem)
	if((browser=="IE")&&(bPlatform=="Mac")) {
		x = Math.round((screen.availWidth/2)-(w/2));
		y = Math.round((screen.availHeight/2)-(h/2));
		eval(name + "Window.moveTo(x,y)"); 
	}
}


// General Pop
function GeneralPop(url,w,h) {
	openBasicWindow("name",url,w,h,"yes","no","no","no");
}


// Config Pop
function ConfigPop(vendor,w,h) {
	openBasicWindow("name",'http://configurator.pny.com/' + vendor + '/index.cfm',w,h,"yes","no","no","no");
}
function ConfigPop2(vendor,w,h) {
	openBasicWindow("name",'http://configurator.pny.com/' + vendor + '/default.asp',w,h,"yes","no","no","no");
}

// open tech spec pop up
	function openWin(url, winname, xsize, ysize) {
	var x,y;
	if (screen) x = (screen.availWidth - xsize) / 2;
	if (screen) y = (screen.availHeight -  ysize) / 2;
	 JSWinn = window.open(url, winname, 'width='+xsize+',height='+ysize+',status=0, scrollbars=1, toolbar=0,resizable=0,menubar=0,left='+x+',top='+y+',');
	
	eval("setTimeout('JSWinn.focus()',500)");

	// move window to center after the fact (ie mac problem)
	if((browser=="IE")&&(bPlatform=="Mac")) {
		x = Math.round((screen.availWidth/2)-(xsize/2));
		y = Math.round((screen.availHeight/2)-(ysize/2));
		eval("JSWinn.moveTo(x,y)"); 
	}
}

// ------------------------------------------------------------------------------------------------------
//General functions

function redirect(url) {
	// redirects the browser to the given url
	document.location.href = url;
}


// used for the final link out
function GoThere(site) {
		if ( window.opener.closed ) {
			window.open(site);
			self.close();
		} else {
			window.opener.location.href = site;
			self.close();
		}
}


function newWin(url) {
	// go to the url
	window.open(url);
}









