// JavaScript Document

function openPopUp(){
	centered("http://pacesalsa.promotionexpert.com/handpickandwin2/freecode.html","315", "367", "none", "freec");
}

function openAwardPopUp(){
	centered("http://pacesalsa.promotionexpert.com/handpickandwin2/award.html","610", "590", "none", "awardp");
}

function closePopUp(){
	window.close();
}

function centered(whatUrl, popW, popH, windowType, windowName)
	{
	var sw = 640, sh = 480;
	sw = screen.availWidth; sh = screen.availHeight;
	
	// default: scrollbars only
	var otherFeatures = ",menubar=0,scrollbars=1,resizable=0,status=0,directories=0,location=0,toolbar=0";

	// no chrome
	if ( windowType == "none" ) { otherFeatures = ",menubar=0,scrollbars=0,resizable=0,status=0,directories=0,location=0,toolbar=0"; }
	
	// some chrome: season to taste
	if ( windowType == "some" ) { otherFeatures = ",menubar=1,scrollbars=1,resizable=0,status=0,directories=0,location=0,toolbar=1"; }

	// all chrome: a normal window with all chrome, but size controlled and centered;
	if ( windowType == "all" )
		{
		popW = 700;
		popH = 460;
		otherFeatures = ",menubar=1,scrollbars=1,resizable=1,status=1,directories=1,location=1,toolbar=1";
		}
	
	var topPos = ((sh-popH)/2)-80;
	if (topPos < 0) { topPos = 0; }
	
	leftPos = ((sw-popW)/2-15);
	if (leftPos < 0) { leftPos = 0; }

	var mywin = window.open( (whatUrl),(windowName),"width="+popW+",height="+popH+",top="+topPos+",left="+leftPos+otherFeatures);
	if (mywin) { mywin.focus(); }
	}

