

var badCharCount = 0;

var win= null;
function popUp2(mypage,myname,w,h,scroll)
{ 
  var winl = (screen.width-w)/2;
  var wint = (screen.height-h)/2;
  var settings  ='height='+h+',';
      settings +='width='+w+',';
      settings +='top='+1+',';
      settings +='left='+1+',';
      settings +='scrollbars='+scroll+',';
      settings +='resizable=yes';
  win=window.open(mypage,myname,settings);
  if(parseInt(navigator.appVersion) >= 4){win.window.focus();}
}

function resizeWindow( theImage )
{
	var 
		myImg = new Image();

	myImg.src = "../admin/photogallery/images/" + theImage;
	
	var w = myImg.width + 100;
	var h = myImg.height + 200;
	
	if ( parseInt( navigator.appVersion ) > 3 ) 
	{
   		if ( navigator.appName == "Netscape" ) 
		{
			top.outerWidth = w;
			top.outerHeight = h;
   		}
	   else top.resizeTo(w,h);
	}

}


function sihider(product,div2,id,si)  
{
	if (document.getElementById) 
		{
		if (product.checked == true)
		document.getElementById(div2).style.display = 'block';
		else
		document.getElementById(div2).style.display = 'none';
		}
		
	else if (document.all) 
		{
		if(document.forms(id).item(product).checked == true)
			{
			document.all.item(div2).style.display = 'block';
			}
		else
			{
			document.all.item(div2).style.display = 'none';
			document.forms(id).item(si).value = "";
			}
		}							
  return false;
}


	
function unhider3(div)
{

if (document.getElementById) 
		{
		document.getElementById(div).style.display = 'none';
		}
	
	else if (document.all) 
		{
		document.item(div).style.display = 'none';
		}							
  return false;
}

function hider3(div)
{

if (document.getElementById) 
		{
		document.getElementById(div).style.display = 'block';
		}	
	
	else if (document.all) 
		{
		document.item(div).style.display = 'block';
		}							
  return false;
}



function hider(abc,div)
{
if (document.getElementById) 
		{
		if(abc.checked == true)
			{
		document.getElementById(div).style.display = 'block';
		document.formeditlogin.password.value = "";
			}
		else
			{
		document.getElementById(div).style.display = 'none';
			}	
		}
	else if (document.all) 
		{
		if(abc.checked == true)
			{
		document.all.div1b.style.display = 'block';
		document.formeditlogin.password.value = "";
			}
		else
			{
		document.all.div1b.style.display = 'none';
			}
		}							
  return false;
}





 

function hider2(div1,div2,div3)
{
if (document.getElementById) 
		{
document.getElementById(div1).style.display = 'block';
document.getElementById(div2).style.display = 'none';
document.getElementById(div3).style.display = 'none';		
		}
	else if (document.all) 
		{

document.all.item(div1).style.display = 'block';
document.all.item(div2).style.display = 'none';
document.all.item(div3).style.display = 'none';

		}							
  return false;
}

function toggleOver( img_name, img_src ) {
	document[img_name].src = img_src;
}
function toggleNormal( img_name, img_src ) {
	document[img_name].src = img_src;
}

function cellover1(tc) { 
tc.className = "categorycell";
}
 
function cellout1(tc) { 
tc.className = "categorycellout";
}

function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=260,height=135,left = 490,top = 412');");
}

function RestrictAlphaSpace ( )
{
      var allowed = /[ a-zA-Z0-9:\x0D]/g;
      var key = String.fromCharCode( window.event.keyCode );
      var good = allowed.test( key );

      if ( !good )
      {
            event.keyCode = 0;
			if( badCharCount == 0 )
			{
				alert("Please enter in only alpha-numeric characters, colons, and spaces.");
				badCharCount = 1;
			}
      }
}




