
function search1()
{
	var s1=document.getElementById("gsearch").value;
	var url=document.getElementById("surl").value;
	//var param=document.getElementById("params").value;
	if((s1!="Search all OIG games")&&(s1!=""))
	{ 
	
	//url=url+"?params="+param+"&q="+s1;
	//self.location=url;
	searchform.submit();  
	}
	else
	{
	document.getElementById("gsearch").value='Search all OIG games';
	}
}
function searchBox()
{
	var a1=document.getElementById("gsearch").value
	if(a1=='Search all OIG games')
	{
	document.getElementById("gsearch").value="";
	document.getElementById("gsearch").focus();
	}
	
}


function popup(dpath,link1,wd,ht,burl)
{	
wd=wd+10;
ht=ht+10;
window.open (dpath+"games.php?id="+link1+"&burl="+burl,"PopupWindow","toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width="+wd+",height="+ht+",left = 220,top = 100"); 
}

function smapopen(con)
{

window.open (con,"PopupWindow","toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=800,height=250,left = 120,top = 100"); 

}


/***************************************************************************************************/

function gotoLocation(url)
{
	self.location=url;
	
}

function gotoUsersSubmit(url)
{
	usersform.submit();  
	
}
/********************************************Left Menu Toggle***********************************************************/

function toggleCat(id)
{
id1="#m"+id;
document.newsform.name1.value="Name";
document.newsform.email1.value="Email";	
var u1= document.getElementById(id+1);
var d1= document.getElementById(id+2);
var mb= document.getElementById(id+'b')
if(d1.style.display  == "block")
{   mb.style.display  = "block";
	d1.style.display  = "none";
	u1.style.display  = "block";
}
else
{   mb.style.display  = "none";
	d1.style.display  = "block";
	u1.style.display  = "none";
}
$(id1).slideToggle();
}

/********************************************Game Box Toggle***********************************************************/

function toggleGbox(id)
{
id1="#"+id+"box";

var u1= document.getElementById(id+"a1");
var d1= document.getElementById(id+"a2");
var mb= document.getElementById(id+'b')
if(d1.style.display  == "block")
{   mb.style.display  = "block";
	d1.style.display  = "none";
	u1.style.display  = "block";
}
else
{   mb.style.display  = "none";
	d1.style.display  = "block";
	u1.style.display  = "none";
}
$(id1).slideToggle();
}

/***********************************************Logout mouseover*********************************************************************/

function getMouseOverChange(id,col)
{
var over= document.getElementById(id);
over.style.color= col;
over.style.textDecoration= "underline"
}
/***********************************************Logout mouseOut*********************************************************************/

function getMouseOutChange(id,col)
{
var over= document.getElementById(id);
over.style.color= col
over.style.textDecoration= "none"
}


/******************************User Profile Email********************************************************************************/

function userPEmail()
{
var a=0;
var email=document.getElementById("u_PEmail").value;
if(email!='')
{
if (email.length>=6) {
			if (email.indexOf("@")>0) {
				if ((email.indexOf("@")+2)<email.lastIndexOf(".")) {
					if (email.lastIndexOf(".")<(email.length-2)) {
						a = 1;
					}
				}
			}
	}
if(a==0)
{
alert("Invalid Email");
document.getElementById("u_PEmail").value="";
}
}
}

/*********************************Email show and admin mail receive****************************************************/

function userShowEmail(id)
{ 
	var val=document.getElementById("u_PEmail").value;
	var checkB;
	if(id==1)
	{
		checkB=document.getElementById("emailshow");
	}
	else if(id==2)
	{
		checkB=document.getElementById("receiveadminemails");
	}
	if(val=='')
	{
		checkB.checked=false;
		alert("Enter your Email address");
		
	}
	
	
}


/**************************Profile Edit*****************************************************/
function profileEdit()
{	
	var first_name=document.profile_edit_form.first_name.value;	
	var dob_yy=document.profile_edit_form.dob_yy.value;
	var dob_mm=document.profile_edit_form.dob_mm.value;
	var dob_dd=document.profile_edit_form.dob_dd.value;
	if(first_name=="")
	alert('Enter name');	
	else if((dob_yy=="")||(dob_mm=="")||(dob_dd==""))
	alert('Check date of birth');
	else
	profile_edit_form.submit();
}


