/* Gerneral Javascripts - For The Flag Ship */

 function winOpen(url)
 {
	 window.open(url, 'win', 'width=800, height=600, resizable=no, scrollbars=yes, toolbar=no, menubar=no');
 }
 

  function imgOpen(ID)
  {
	var win= null;
    var w = 669;
	var h = 530;
	var winl = (screen.width-w)/2;
    var wint = (screen.height-h)/2;
    var settings  ='height='+h+',';
    settings +='width='+w+',';
    settings +='top='+wint+',';
    settings +='left='+winl+',';

    win = window.open('/yourphotos/viewpicture/?id=' + ID, 'win', settings + 'resizable=no, scrollbars=no, toolbar=no, menubar=no');
          
	if(parseInt(navigator.appVersion) >= 4){
	  win.window.focus();
	}
  }
 
 function closeWin()
 {
	 window.close();
 }
 
 function display(ID)
 {
	if (document.getElementById(ID).style.display == 'none')
	{
		document.getElementById(ID).style.display = 'block';
	}
	else if (document.getElementById(ID).style.display == 'block')
	{
		document.getElementById(ID).style.display = 'none';
	}
 }
 
 function disable(ID)
 {
	 document.getElementById(ID).style.value = 'Please Wait';
	 document.getElementById(ID).style.disabled = 'true';
 }
 
 function showRemote(shout) {
	 //self.name = "main"; // names current window as "main"
	 
	 var windowprops = "toolbar=0,location=0,directories=0,status=1, " + "menubar=0,scrollbars=1,resizable=0,width=350,height=450";
	 
	 OpenWindow = window.open("/admin/choosepics/?shout=" + shout, "remote", windowprops); // opens remote control
	 OpenWindow.creator=self; // names current window as "main"
  }
  
  function pollPicCount(hiddenField, checkBox)
  {	  
     field = Number(document.getElementById(hiddenField).value);
	 
	 if(document.getElementById(checkBox).checked == true)
	 {	 
	    if(field >= 6)
	    {
		  alert('You can only select upto 6 pictures for the poll'); 
		  return false;
	    }
	    else
	    {	 
	      document.getElementById(hiddenField).value = field + Number(1);
		  return true;
	    } 
	 }
	 else
	 {
		document.getElementById(hiddenField).value = field - Number(1);
	 }
  }
  
  function pollSubmit(hiddenField)
  {
	  field = Number(document.getElementById(hiddenField).value);
	  //alert('Hello Mum');
	  if(field < 6)
	  {
		alert('Please select 6 pictures for the Poll');  
		return false;
	  }
	  else
	  {
		  return true;
	  }
  }