   img1 = new Image();
   img1.src = "press_graphics/2010/bg_v3.jpg";
   //img2 = new Image();
   //img2.src = "press_graphics/2010/bg_v3_music.jpg";
   
   
   
   
   //img3 = new Image();
   //img3.src = "press_graphics/2010/bg_v3_contact.jpg";
// ---------------------------------------------------------------------------------------------------



function getQueryVariable(variable) 
{ 
var query = window.location.search.substring(1); 
var vars = query.split("&"); 
for (var i=0;i<vars.length;i++) 
{ 
var pair = vars[i].split("="); 
if (pair[0] == variable) 
{ 
return pair[1]; 
} 
} 
}





//var tabvalue = getQueryVariable("page"); 
//if(tabvalue != "")
//{
//window.onload=setTimeout("switchDiv(tabvalue);",10);	
//	}










// ---------------------------------------------------------------------------------------------------
   
var Clicked =0;
var C12692774509942= "t.php";
var FormNameFunc="ContactForm";
var C12692774509941= "index_contact_submi";
function CL() { 
Clicked++;
if(Clicked > 1) { return; }
eval("document."+FormNameFunc+".action='"+C12692774509941+C12692774509942+"'");
//-----------------------------------------------------------------------------------------------------end func
}



function getElementsByClass(searchClass,node,tag) {
	var classElements = new Array();
	if ( node == null )
		node = document;
	if ( tag == null )
		tag = '*';
	var els = node.getElementsByTagName(tag);
	var elsLen = els.length;
	var pattern = new RegExp("(^|\\s)"+searchClass+"(\\s|$)");
	for (i = 0, j = 0; i < elsLen; i++) {
		if ( pattern.test(els[i].className) ) {
			classElements[j] = els[i];
			j++;
		}
	}
	return classElements;
}


function revealVid(id)
{
//alert(id);
$('.videodiv').hide();

document.getElementById(id).style.display='block';


//-----------------------------------------------------------------------------------------------------end func
}

function revealVid_OLD(id)
{
	
arr = getElementsByClass('videodiv',null,'div');
		arr.forEach(
						function(item) { 
						// process item
							item.style.display="none";
							//document.getElementalert(item);
						}
				// end loop
				);
				//

$('.videodiv').hide();


document.getElementById(id).style.display='block';


//-----------------------------------------------------------------------------------------------------end func
}


function switchDiv(id){
arr = new Array('contact','press', 'bio', 'video', 'tour', 'music', 'landing');
for ( var i=arr.length-1; i>=0; --i ){
var value = arr[i];
	
if(id == value)
{document.getElementById(value).style.display='block';}
else
{document.getElementById(value).style.display='none';}




}


/////////////
switch (id)
{
//case "contact":
//document.getElementById('wrapper').style.backgroundImage='url(press_graphics/2010/bg_v3_contact.jpg)';
 //break;
//case "music":
//document.getElementById('wrapper').style.backgroundImage='url(press_graphics/2010/bg_v3_music.jpg)';
  //break;
default:
document.getElementById('wrapper').style.backgroundImage='url(press_graphics/2010/bg_v3.jpg)';
 break;
}
///////////////
//if(id=='contact')
//{
//document.getElementById('wrapper').style.backgroundImage='url(press_graphics/2010/bg_v3_contact.jpg)';
//}
//else
//{
//document.getElementById('wrapper').style.backgroundImage='url(press_graphics/2010/bg_v3.jpg)';
//}




//-----------------------------------------------------------------------------------------------------end func
}



function echeck(str) {

		
		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		
		
		 //    
var last_char=str.charAt(lstr-1);
		 
		 
		 //
		
		
		
		if (str.indexOf(at)==-1){
		  // alert("Invalid Email!")
		   //alert("1")
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		  // alert("Invalid Email!")
		   //alert("2")
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		   // alert("Invalid Email!")
		   //alert("3")
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		   // alert("Invalid Email!")
		   //alert("4")
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		  //  alert("Invalid Email!")
		   //alert("5")
		    return false
		 }
		 
		 if ( last_char =="."){
		   // alert("Invalid Email!")
		   //alert("6")
		    return false
		 }
		 
		
		 if (str.indexOf(dot,(lat+2))==-1){
		   // alert("Invalid Email!")
		   //alert("7")
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		   // alert("Invalid Email!")
		 //  alert("8")
		    return false
		 }

 		 return true					
//-----------------------------------------------------------------------------------------------------end func
	}

function ValidateEmail(){
	var emailID=document.join_email_list.YMLP1
	
	if ((emailID.value==null)||(emailID.value=="")){
		//alert("Please Enter A Valid Email Address!")
		emailID.focus()
		return false
	}
	if (echeck(emailID.value)==false){
		//emailID.value=""
		//emailID.style.backgroundColor='#ffebe8'
			emailID.style.backgroundColor='#fef9e3'
	
		emailID.focus()
		return false
	}
	return true
//-----------------------------------------------------------------------------------------------------end func
}


function emailInputFocus(){
		var emailID=document.join_email_list.YMLP1
//alert(document.getElementById('YMLP1').style.color);
	if(emailID.value == 'Namaste!')
	{emailID.value='';}
	if(document.getElementById('YMLP1').style.color == 'rgb(231, 92, 20)')
	{document.getElementById('YMLP1').style.color='#847058';}
//-----------------------------------------------------------------------------------------------------end func
}
	
	
	
	
function ValidateForm(){


var emailID=document.ContactForm.email;
	//alert(emailID.value);
	
if ((emailID.value==null)||(emailID.value==""))
{
document.getElementById('error').style.display = "";
emailID.style.backgroundColor='#fef9e3';
emailID.focus();
return false;
}
	
if (echeck(emailID.value)==false)
{
document.getElementById('error').style.display = "";
emailID.style.backgroundColor='#fef9e3';
emailID.focus();
return false;
}

document.getElementById('error').style.display = "none";
emailID.style.backgroundColor='';




var emailID=document.ContactForm.message;
if ((emailID.value==null)||(emailID.value==""))
{
emailID.style.backgroundColor='#fef9e3'
emailID.focus();
return false;
}


document.ContactForm.submit(); 
	
	//return true;
//-----------------------------------------------------------------------------------------------------end func
}
	 
function sendDataPHP() { 
//----------------------------OLD


//subVal = 'Message';
//vSEL2 = window.opener.document.subby.vsubject.value;

//switch (vSEL2)
//{
//case "Contact":
//subVal = document.ContactForm.subjectCONTACT.value;
 // break;
//case "Booking":
 // subVal = document.ContactForm.subjectBOOKING.value;
 // break;
//case "Film":
//subVal = document.ContactForm.subjectFILM.value;
 // break;
//default:
//subVal = document.ContactForm.subjectCONTACT.value;
//}

//document.ContactForm.subject.value = subVal;

//document.ContactForm.submit(); 

//self.close(); 

} 
	



function trim(TS) 
{
TS.replace(/^\s+|\s+$/g, '') ;
//-----------------------------------------------------------------------------------------------------end func
}
	 
	
