//var dvalue=1;
//var preVal=1;
//
//function checkOpen(myVar){
//	if(document.getElementById("galleryMain"+myVar).style.display=="none")
//	   {
//		document.getElementById("galleryMain"+myVar).style.display="block";
//      	}
//	
//else
//		{
//			document.getElementById("galleryMain"+myVar).innerHTML="";	
//			document.getElementById("galleryMain"+myVar).style.display="none";			
//		}
//	
//}


var dvalue=1;
var preVal=1;


function checkOpen(myVar){
	if(document.getElementById("galleryMain"+myVar).style.visibility=="hidden")
	{
		document.getElementById("galleryMain"+myVar).style.visibility="visible";
	}
	else{
		if(parent.myDisplay=="on")
		{
		parent.checkOpen1(myVar);
		}
		else
		{
			document.getElementById("galleryMain"+myVar).style.visibility="hidden";			
		}
	}
}



function checkOpen1(myVar){
	if(document.getElementById("myFrame"+myVar).style.display=="none")
	{
		document.getElementById("myFrame"+myVar).style.display="block";	
	}
	else{
		document.getElementById("myFrame"+myVar).style.display="none";	
	}
	
	document.getElementById('frame'+myVar).contentWindow.runScrolls();

}


function checkOpen2(myVar){
	if(document.getElementById("myFrame"+myVar).style.display=="none")
	{
		clearInterval(loop);
		document.getElementById("myFrame"+myVar).style.display="block";	
	}
	else{
		loop = setInterval(function(){$('.homeEffect').showNext(fadeSpeed);}, loopInterval);		
		document.getElementById("myFrame"+myVar).style.display="none";	
	}
	
}


function galleryView(getVal){
	if(getVal=='noIdea1'){
		if(preVal!=1)
		{
		getVal=preVal-1;
		}
		else
		{
		getVal=preVal;
		}
	}
	
	if(getVal=='noIdea2'){
		if(preVal!=total)
		{
		getVal=preVal+1;
		}
		else
		{
		getVal=preVal;
		}
	}	

	if(dvalue==1)
	{
		getVal=1;
		document.getElementById("b"+getVal).style.display="block";
		document.getElementById("q"+getVal).style.display="block";
		document.getElementById("t"+getVal).setAttribute("class", "selected");
		document.getElementById("t"+getVal).setAttribute("className", "selected");		
		dvalue=0;
		preVal=getVal;
	}
	else{
		document.getElementById("b"+preVal).style.display="none";
		document.getElementById("q"+preVal).style.display="none";
		document.getElementById("t"+preVal).setAttribute("class", "");
		document.getElementById("t"+preVal).setAttribute("className", "");		

		document.getElementById("b"+getVal).style.display="block";
		document.getElementById("q"+getVal).style.display="block";
		document.getElementById("t"+getVal).setAttribute("class", "selected");
		document.getElementById("t"+getVal).setAttribute("className", "selected");		
		preVal=getVal;
	}	
}


function onein(i){
var ide = document.getElementById("myFrame4");

        if (ide.style.display=="block")
			{	 
			  ide.style.display="none";	 
			  document.getElementById("myiframe").setAttribute("src","");
						 
			} 	 
			
	else   {  
	
	          if (i==1)
	           {
		        ide.style.display="block";						 
  			    document.getElementById("myiframe").setAttribute("src","../inc/a4.php");
			   }
			  
			  else { 			   
		        ide.style.display="block";						 
  			    document.getElementById("myiframe").setAttribute("src","../inc/a5.php");
			   }
	
			 }		
	
	}




function oneins(i){
var ide = document.getElementById("myFrame4");

        if (ide.style.display=="block")
			{	 
			  ide.style.display="none";	 
			  document.getElementById("myiframe").setAttribute("src","");
						 
			} 	 
			
	else   {  
	
	          if (i==1)
	           {
		        ide.style.display="block";						 
  			    document.getElementById("myiframe").setAttribute("src","../inc/gallery-v4.php");
			   }
			  
			  else { 			   
		        ide.style.display="block";						 
  			    document.getElementById("myiframe").setAttribute("src","../inc/gallery-v4.php");
			   }
	
			 }		
	
	}


 

