// JavaScript Document


      function confirmSubmit2() {

      var agree=confirm("Do you really want to delete selected banner(s) ?");

      if (agree)
       return true ;
      else
       return false ;

    }
	
	
      function confirmRemove(id3) {
		

      var agree=confirm("Do you really want to remove the selected banner?");

		if (agree)
		window.location = "advertisorUploadComplete.php?action=remove_item&id=" + id3;
		else
		return false;

    }
	
	
	function chgBg(obj,color){
if (document.all || document.getElementById)
  obj.style.backgroundColor=color;
else if (document.layers)
  obj.bgColor=color;
}


function createTarget(t){
window.open("", t, "width=450,height=300");
return true;
}


function chgClass(obj,classto){
if (document.all || document.getElementById)
  obj.className = classto;
else if (document.layers)
  obj.className = classto;
}



function hiliteBoxes2() 
{
  var pickList = document.getElementById("finalCats[]");
  var pickIndex = pickList.selectedIndex;
  var pickOptions = pickList.options;
  var pickOLength = pickOptions.length;
  


  for(var i=0; i< pickOLength; i++)
  {
	   
		
		if(pickOptions[i].value != 0)
        pickOptions[i].selected = true;

  }
}


function confirmSubmit(url) 
{
	var agree = confirm("Click OK to enter this competition");
	
	if (agree)
		window.open(url,'login','menubar=yes,toolbar=yes,location=yes,directories=yes,titlebar=yes,status=yes,scrollbars=yes,resizable=yes');
	else
		return false;
}
	
function doregister(id)
{
	

	
	var id2 = id;
	
	var agree = confirm("To enter competitions you need to be registered as a member.\n\n Click OK if you would like to login or register to be a member.");
	
	if (agree)
	window.location = "memberLogin.php?id=" + id2;
	else
	return false;
}



function gettext()
{
	window.document.getElementById("fonttext").value = window.document.getElementById("counttxt").value;
}


function tnc(tmsg, url)
{

	
	var agree = confirm(tmsg + "\n\n Click OK to read and accept our terms and conditions.");
	
	if (agree)
	window.location = url;
	else
	return false;	
}


function notamember()
{
alert("Competitions can only be entered by members");	
}

function callme()
{
	
	alert('test');	
}

function openwindow(url)
{
window.open(url,'mywin','left=20,top=20, toolbar=1,resizable=1');
}



imgout=new Image(9,9);
imgin=new Image(9,9);

/////////////////BEGIN USER EDITABLE///////////////////////////////
	imgout.src="images/closed.gif";
	imgin.src="images/open.gif";
///////////////END USER EDITABLE///////////////////////////////////

//this switches expand collapse icons
function filter(imagename,objectsrc){
	if (document.images){
		document.images[imagename].src=eval(objectsrc+".src");
	}
}

//show OR hide funtion depends on if element is shown or hidden
function shoh(id) { 
	
	if (document.getElementById) { // DOM3 = IE5, NS6
		if (document.getElementById(id).style.display == "none"){
			document.getElementById(id).style.display = 'block';
			filter(("img"+id),'imgin');			
		} else {
			filter(("img"+id),'imgout');
			document.getElementById(id).style.display = 'none';			
		}	
	} else { 
		if (document.layers) {	
			if (document.id.display == "none"){
				document.id.display = 'block';
				filter(("img"+id),'imgin');
			} else {
				filter(("img"+id),'imgout');	
				document.id.display = 'none';
			}
		} else {
			if (document.all.id.style.visibility == "none"){
				document.all.id.style.display = 'block';
			} else {
				filter(("img"+id),'imgout');
				document.all.id.style.display = 'none';
			}
		}
	}
}