// popup for comments and other various pages
function popUp(URL,x,y,z,w) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL,'" + id + "','title=0,toolbar=0,borders=0,scrollbars=" + z + ",location=0,statusbar=0,menubar=0,resizable=" + w + ",width=" + x + ",height=" + y + ",left = 25,top = 25');");
}

//radio pops
function OpenRadio(){
Radio = window.open('/forums/vBRadio.php','vBRadio','directories=no,height=570,width=360,location=no,menubar=no,resizable=yes,status=no,toolbar=no')
return false;
}

// popup for comments on loading of entry page
function popUpCmt(eid){
URL = "ent_comments.php?eid="+eid+"#last";
var x = 550;
var y = 350;
var z = 1;
var w = 1;
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL,'" + id + "','title=0,toolbar=0,borders=0,scrollbars=" + z + ",location=0,statusbar=0,menubar=0,resizable=" + w + ",width=" + x + ",height=" + y + ",left = 25,top = 25');");
}

// popup for slag ticker
function popUpTicker(slagid){
URL = "slag_ticker.php?cid="+slagid;
var x = 750;
var y = 450;
var z = 1;
var w = 1;
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL,'" + id + "','title=0,toolbar=0,borders=0,scrollbars=" + z + ",location=0,statusbar=0,menubar=0,resizable=" + w + ",width=" + x + ",height=" + y + ",left = 0,top = 0');");
}

// popup for stats on loading of slag page
function popUpWhoVoted(slagid){
URL = "whovoted.php?cid="+slagid;
var x = 475;
var y = 550;
var z = 1;
var w = 1;
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL,'" + id + "','title=0,toolbar=0,borders=0,scrollbars=" + z + ",location=0,statusbar=0,menubar=0,resizable=" + w + ",width=" + x + ",height=" + y + ",left = 0,top = 0');");
}

// popup for slag entries - full view
function popUpEntry(URL,x,y,z,w) {
day = new Date();
id = day.getTime();
x=x+24;
y=y+24;

eval("page" + id + " = window.open(URL,'" + id + "','title=0,toolbar=0,borders=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=" + w + ",width=" + x + ",height=" + y + ",left=25,top=25');");
}

// clear text in form field upon click
function clearText(thefield){
	if (thefield.defaultValue==thefield.value)
	thefield.value = ""
	}
	
// called in popup link when closing window and going to new url in parent window
function gototop(href) {
      window.opener.top.location.href = href; 		
}   

// drop-down select box action
function selectjump(frmName)
{
	box = frmName.navi;
	destination = box.options[box.selectedIndex].value;
	if (destination) location.href = destination;
}

// obvious
function validatePollRadio(objForm){
     var err='';
     var objFocus='';
     if(objForm.votecast[0].checked){
          if(!objFocus){
               objFocus=objForm.votecast[1];
          }
          err+='OMG!!1! You forgot to select your choice.';
     }
     
     if(err){
          alert(err);
          objFocus.focus();
     }
   return !err;
}


function galfullScreen(obj) {
	var sw = screen.width;
	var sh = screen.height;
	var winOpt = "width=" + (sw * 1) + ",height=" + (sh * 1) + ", scrollbars=yes";
	thisWin = window.open(obj.href,obj.target,winOpt);
}

function folioFullScreen(urlz) {
	var sw = screen.width;
	var sh = screen.height;
	var winOpt = "width=" + (sw * 1) + ",height=" + (sh * 1) + ", scrollbars=yes";
	day = new Date();
	id = day.getTime();
//	thiswin = window.open(urlz,"Portfolio",winOpt);
	eval("diswin" + id + " = window.open(urlz,'" + id + "','" + winOpt + "');");
}

//open full window for gallery
//window.open(theURL, '', 'fullscreen=yes, scrollbars=yes');
//}

// obvious
function validatePollCheckBx(pollvote) {

		if  ((document.pollvote.c1.checked!=true) && (document.pollvote.c2.checked!=true) && (document.pollvote.c3.checked!=true) && (document.pollvote.c4.checked!=true) && (document.pollvote.c5.checked!=true) && (document.pollvote.c6.checked!=true) && (document.pollvote.c7.checked!=true) && (document.pollvote.c8.checked!=true)) { 
    alert ("OMG!!1! You forgot to select your choice(s).");
	return false;
		}
}

