
function show(id)
{
	var id1 = document.getElementById(id);
	if(id1.style.display == "none")
	id1.style.display = "block";
	else if(id1.style.display == "block")
	id1.style.display = "none";
	else
	id1.style.display = "block";

}

function showww(id)
{
	var id1 = document.getElementById(id);
	id1.style.display = "block";

}

function changecatgal()
{
var name = document.formsubk.catbb.value;
var subid = document.formsub.subid.value;
var catb = document.formcat.catb.value;

location.href = 'gallery.php?catbb='+name+'&catb='+catb+'&subid='+subid ;

}


function changecatgall(id)
{
var name = document.formsubk.catbb.value;
var subid = document.formsub.subid.value;
var catb = document.formcat.catb.value;

location.href = 'gallery.php?catbb='+name+'&catb='+catb+'&subid='+subid+'&show=1' ;
showww(id) ;
}

function hider(id)
{
	var id1 = document.getElementById(id);
	id1.style.display = "none";
}

function validateshortsearch()
{
		var erc = 0;

		if(document.search.searchh1 && document.search.searchh1.value=='' )
		{
		alert("Enter Search term");
		document.search.searchh1.focus();
		erc++;
		return false;
		}
		return true;
	
}

function changestyle(id ,  imgName)
{

 var id1 =	document.getElementById(id);
 document.getElementById(id).style.background = "url(" + imgName + ")"; 
	
}

   function PopupPic(sPicURL) {
     window.open( "popup.htm?"+sPicURL, "",  
     "resizable=1,HEIGHT=200,WIDTH=200");
   }
   
function hide(id)
{
	var id1 = document.getElementById(id);
	id1.style.display = "none"

}

function validatemail()
{
	var errornumm = 0;
		if(document.mer.email && document.mer.email.value=='' )
		{
		alert("Please enter Your Email");
		document.mer.email.focus();
		errornumm++;
		return false;
		}
		
	   if(-1 == document.mer.email.value.indexOf("@")) { 
       document.mer.email.focus(); 
       alert("Your email must have a '@'."); 
	   errornumm++;
       return false; 
       }
    if(-1 != document.mer.email.value.indexOf(",")) { 
       document.mer.email.focus(); 
       alert("Your email must not have a ',' in it"); 
	   errornumm++;
       return false; 
       }
    if(-1 != document.mer.email.value.indexOf("#")) { 
       document.mer.email.focus(); 
       alert("Your email must not have an '#' in it." ); 
	   errornumm++;
       return false; 
       }
    if(-1 != document.mer.email.value.indexOf("!")) { 
       document.mer.email.focus(); 
       alert("Your email must not have a '!' in it." ); 
	   errornumm++;
       return false; 
       }
    if(-1 != document.mer.email.value.indexOf(" ")) { 
       document.mer.email.focus(); 
       alert("Your email must not have a space in it." ); 
	   errornumm++;
       return false; 
       }
    if(document.mer.email.value.length ==
         (document.mer.email.value.indexOf("@")+1) ) {
       document.mer.email.focus();
       alert("Your email must have a domain name after the '@'.");
	   errornumm++;
       return false;
       }

	if(errornumm < 1)
	{	
	document.mer.submit();	
	}
	
}

function validatelogin()
{
	var errornum = 0;
		if(document.reg.username && document.reg.username.value=='' )
		{
		alert("Please enter UserName");
		document.reg.username.focus();
		errornum++;
		return false;
		}
		if(document.reg.password && document.reg.password.value=='' )
		{
		alert("Please enter Password");
		document.reg.password.focus();
		errornum++;
		return false;
		}

		
	if(errornum < 1)
	{	
	document.reg.submit();	
	}
	
}

var newwindow;
function poptastic(url, width, height)
{
	
	newwindow=window.open(url,'name','height='+height+',width='+width +', resizable');
	if (window.focus) {newwindow.focus()}
}
function poptastic2(url, width, height)
{
	
	newwindow=window.open(url,'name','height='+height+',width='+width);
	if (window.focus) {newwindow.focus()}
}