
	// Popup Window Code
	function popup(winname, winurl, winopt, winwidth, winheight)
	{
		//var winname = "Popup";
		height = screen.availHeight;
		height = (height - winheight) / 2;
		width  = screen.availWidth;
		width  = (width - winwidth) / 2;
		winopt = winopt + ",left=" + width + ",top=" + height + ",width=" + winwidth + ",height=" + winheight;
		var newwin  = window.open(winurl,winname,winopt);
                return newwin;
	}

 // Choose Judges Popup Window
        function JudgesPopup( itemid )
        {
           top.newwin = popup('JudgesPopup','http://www.newyorkfestivals.tv/nyfajudges/','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,copyhistory=0,resizable=0','810','400')
        }


        // Choose Category Popup Window
        function ChooseCategory( cmptnid )
        {
           top.newwin = popup('CategorySelect','pop/category.php?CmptnID=' + cmptnid,'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,copyhistory=0,resizable=0','500','550')
        }


        // Choose Category Popup Window
        function CreditsPopup( itemid )
        {
           top.newwin = popup('CreditsPopup','main.php?ItemID=' + itemid,'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,copyhistory=0,resizable=0','500','550')
        }


        // ShowInstructions
        function ShowInstructions( path, section )
        {
           var randomNumber = Math.floor(Math.random() * 200000)
           top.newwin = popup('ShowInstructions','main.php?p=' + path + '&rand='+ randomNumber + '#' + section,'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,copyhistory=0,resizable=0','500','550')
           }
           
           // Episode Select
	   function test(what)
	   {       		       	 			
	       if(what == 0)
	       {
	       if (document.Entry.plid[what].checked)
	       		{

	            document.getElementById('layer1').style.display = 'none';
	            document.getElementById('layer12').style.display = 'none';
	           	 }
	       }
	        if(what == 2)
	       	{
	       		       	 document.getElementById('layer12').style.display = 'block';
	       	 document.getElementById('layer1').style.display = 'none';
	       	 if (document.Entry.plid[what].checked)
	       	 	{
	       	 document.getElementById('layer12').style.display = 'block';
	       	 document.getElementById('layer1').style.display = 'none';
	       	 	}
	       	}
	      if(what == 1)
	       {
	       if (document.Entry.plid[what].checked)
	       		{
	            document.getElementById('layer1').style.display = 'block';
	            document.getElementById('layer12').style.display = 'none';
	       		}
	       	}
	   }    
           
           
