// JavaScript Document

function show_sig(id){
	document.getElementById(id).style.display="block";
}
function hide_sig(id){
	document.getElementById(id).style.display="none";
}    
//image change//

function randomEventHide(optionVal)
{
	var optionIndex = optionVal;
	var indexOfOneTimeEvent = optionIndex.indexOf("One Time Event");
	var indexOfEveryWeek = optionIndex.indexOf("Every Week");	
	var indexOfEveryTwoWeeks = optionIndex.indexOf("Every Two Weeks");
	var indexOfEveryMonth = optionIndex.indexOf("Every Month");
	var indexOfOnceYear = optionIndex.indexOf("Once a Year");
	var indexOfTwiceYear = optionIndex.indexOf("Twice a Year");
	var indexOfRandomEvent = optionIndex.indexOf("Random Event");
	
	if(parseInt(indexOfOneTimeEvent)>0 || optionVal=='')
	{
		document.getElementById('RepeateUntil').style.display="none";
		document.getElementById('RepeateUntilYear').style.display="none";
		document.getElementById('RandomEvent').style.display="none";
	}
	else if(parseInt(indexOfEveryWeek)>0 || parseInt(indexOfEveryTwoWeeks)>0 || parseInt(indexOfEveryMonth)>0)
	{
		document.getElementById('RepeateUntil').style.display="block";
		document.getElementById('RepeateUntilYear').style.display="none";
		document.getElementById('RandomEvent').style.display="none";
	}
	else if(parseInt(indexOfOnceYear)>0 || parseInt(indexOfTwiceYear)>0)
	{
		document.getElementById('RepeateUntil').style.display="none";
		document.getElementById('RepeateUntilYear').style.display="block";
		document.getElementById('RandomEvent').style.display="none";
	}
	else if(parseInt(indexOfRandomEvent)>0)
	{
		document.getElementById('RepeateUntil').style.display="none";
		document.getElementById('RepeateUntilYear').style.display="none";
		document.getElementById('RandomEvent').style.display="block";
	}
}

function show() 
{
	var tmp = document.getElementById("menu2").style.display;
	 
	
	if(tmp == 'none')
    {
        document.getElementById("menu2").style.display="block";
		document.getElementById("less").src="/gaynabout/web/images/less.gif";
    }
    else 
    {
        document.getElementById("menu2").style.display="none";
		document.getElementById("less").src="/gaynabout/web/images/more.gif";
    }
}
//common for profile page//
function comshow(mode,i) 
{
    if(mode=="show")
    {
       document.getElementById("OpenLi"+i).style.display="";
       
       document.getElementById("ClosedLi"+i).style.display="none";
      // document.getElementById("inner"+i).style.display="";
      new Effect.BlindDown("inner"+i); 
      //visual_effect('BlindDown',"inner"+i);
       
	}
    else 
    {
        document.getElementById("OpenLi"+i).style.display="none";
        document.getElementById("ClosedLi"+i).style.display="";
       // document.getElementById("inner"+i).style.display="none";
       new Effect.BlindUp("inner"+i); 
    }
}

//popup window
function popup(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
//index page///
var divIdStore=["1","2","3","4","5"];

function show_ind(id)
{
	
	if(document.gaTextAni){
		document.gaTextAni.SetVariable("mycurparam",id);
			document.gaTextAni.SetVariable("flashcallval",id);
		}
	
	var curId="dv"+id;
	//alert("test"+id)
	//document.getElementById(curId).style.display="block";
	
	if(document.gaTextAni){
		document.gaTextAni.SetVariable("mycurparam",id);
			document.gaTextAni.SetVariable("flashcallval",id);
		}
	
	
	if(id == 5)
	{
		document.getElementById('login_heading').className="blue_h";
		document.getElementById('signup_link').className="blue_h";
		document.getElementById('login_button').className="blueBt";	
		
	}
	else if(id == 2)
	{
			document.getElementById('login_heading').className="orange_h";
			document.getElementById('signup_link').className="orange_h";
			document.getElementById('login_button').className="orangeBt";
	}
	else if(id == 3)
	{
		document.getElementById('login_heading').className="green_h";
		document.getElementById('signup_link').className="green_h";
		document.getElementById('login_button').className="greenBt";
	}
	else if(id == 4) 
	{
		document.getElementById('login_heading').className="perpal_h";
		document.getElementById('signup_link').className="perpal_h";
		document.getElementById('login_button').className="perpalBt";    
	}
	else
	{
		document.getElementById('login_heading').className="yellow_h";
		document.getElementById('signup_link').className="yellow_h";
		document.getElementById('login_button').className="yellowBt";			
	}
	
	for (var i=0;i<5;i++)
	{
		var curIdStoreVal=divIdStore[i];
		
		if(curIdStoreVal!=id)
		{
			 hide_ind(curIdStoreVal);
			 
		}
}
	
	
	
	
}
function hide_ind(id){
		var curId="dv"+id;		
		//alert(curId);
	//document.getElementById(curId).style.display="none";
}



// -----------Edit Profile Tab Menu---------//
function matshow1(){
		document.getElementById("divError1").style.display="";
		document.getElementById("divError2").style.display="none";
		document.getElementById("divError3").style.display="none";
		document.getElementById("divError4").style.display="none";
		document.getElementById("matter1").style.display="block";
		document.getElementById("tog1").className="active";
}
function mathide1(){
		document.getElementById("matter1").style.display="none";
		document.getElementById("tog1").className="";
}
function matshow2(){
		document.getElementById("divError21").style.display="";
		document.getElementById("divError1").style.display="none";
		document.getElementById("divError3").style.display="none";
		document.getElementById("divError4").style.display="none";
		document.getElementById("matter2").style.display="block";
		document.getElementById("tog2").className="active";
}
function mathide2(){
		document.getElementById("matter2").style.display="none";
		document.getElementById("tog2").className="";
}
function matshow3(){
		document.getElementById("divError3").style.display="";
		document.getElementById("divError1").style.display="none";
		document.getElementById("divError2").style.display="none";
		document.getElementById("divError4").style.display="none";
		document.getElementById("matter3").style.display="block";
		document.getElementById("tog3").className="active";
}
function mathide3(){
		document.getElementById("matter3").style.display="none";
		document.getElementById("tog3").className="";
}
function matshow4(){
		document.getElementById("divError4").style.display="";
		document.getElementById("divError1").style.display="none";
		document.getElementById("divError2").style.display="none";
		document.getElementById("divError3").style.display="none";
		document.getElementById("matter4").style.display="block";
		document.getElementById("tog4").className="active";
}
function mathide4(){
		document.getElementById("matter4").style.display="none";
		document.getElementById("tog4").className="";
}
// -----------Edit Profile Tab Menu---------//
///common Js//
function commshow(id){
	document.getElementById(id).style.display="block";
}

function commhide(id){
	document.getElementById(id).style.display="none";
}
//-----------
function addCategory() {
    document.getElementById("mailAddCate").style.display="block";
}
function addCategoryHide() {
    document.getElementById("mailAddCate").style.display="none";
}			

//common for profile page//
// -----------popup script---------//
function popup(mylink, windowname)
{
if (! window.focus)return true;
var href;
if (typeof(mylink) == 'string')
   href=mylink;
else
   href=mylink.href;
window.open(href, windowname, 'width=440,height=160,scrollbars=no,top=300,left=290');
return false;
}
// -----------popup script end---------//

// -----------popup image ---------//
function popupImage(mylink, windowname, id)
{
if (! window.focus)
	return true;
var href;
if (typeof(mylink) == 'string')
   href=mylink;
else
   href=mylink.href;
   
window.open(href, windowname, 'width=570,height=460,scrollbars=yes,top=300,left=240');
return false;
}

// -----------popup video ---------//
function popupVideo(mylink, windowname, id)
{
if (! window.focus)
	return true;
var href;
if (typeof(mylink) == 'string')
   href=mylink;
else
   href=mylink.href;
   
window.open(href, windowname, 'width=570,height=460,scrollbars=yes,top=300,left=240');
return false;
}

// -----------popup music ---------//
function popupMusic(mylink, windowname, id)
{
if (! window.focus)
	return true;
var href;
if (typeof(mylink) == 'string')
   href=mylink;
else
   href=mylink.href;
   
window.open(href, windowname, 'width=570,height=460,scrollbars=yes,top=300,left=240');
return false;
}
//for wide screen//
function ShowHide(id) 
{
	if (document.getElementById(id).style.display=="block") {
	   document.getElementById(id).style.display="none";
    } else {
    	if (screen.width > 1024) {
    		document.getElementById(id).style.display="block";
    	} else {
    		 document.getElementById(id).style.display="none";
    	}
    }
 }