	//** Tab Content script v2.0- � Dynamic Drive DHTML code library (http://www.dynamicdrive.com)
	//** Updated Oct 7th, 07 to version 2.0. Contains numerous improvements:
	//   -Added Auto Mode: Script auto rotates the tabs based on an interval, until a tab is explicitly selected
	//   -Ability to expand/contract arbitrary DIVs on the page as the tabbed content is expanded/ contracted
	//   -Ability to dynamically select a tab either based on its position within its peers, or its ID attribute (give the target tab one 1st)
	//   -Ability to set where the CSS classname "selected" get assigned- either to the target tab's link ("A"), or its parent container
	//** Updated Feb 18th, 08 to version 2.1: Adds a "tabinstance.cycleit(dir)" method to cycle forward or backward between tabs dynamically
	//** Updated April 8th, 08 to version 2.2: Adds support for expanding a tab using a URL parameter (ie: http://mysite.com/tabcontent.htm?tabinterfaceid=0) 
	
	////NO NEED TO EDIT BELOW////////////////////////
	
	function ddtabcontent(tabinterfaceid){
		this.tabinterfaceid=tabinterfaceid //ID of Tab Menu main container
		this.tabs=document.getElementById(tabinterfaceid).getElementsByTagName("span") //Get all tab links within container
		this.enabletabpersistence=true
		this.hottabspositions=[] //Array to store position of tabs that have a "rel" attr defined, relative to all tab links, within container
		this.currentTabIndex=0 //Index of currently selected hot tab (tab with sub content) within hottabspositions[] array
		this.subcontentids=[] //Array to store ids of the sub contents ("rel" attr values)
		this.revcontentids=[] //Array to store ids of arbitrary contents to expand/contact as well ("rev" attr values)
		this.selectedClassTarget="link" //keyword to indicate which target element to assign "selected" CSS class ("linkparent" or "link")
	}
	
	ddtabcontent.getCookie=function(Name){ 
		var re=new RegExp(Name+"=[^;]+", "i"); //construct RE to search for target name/value pair
		if (document.cookie.match(re)) //if cookie found
			return document.cookie.match(re)[0].split("=")[1] //return its value
		return ""
	}
	
	ddtabcontent.setCookie=function(name, value){
		document.cookie = name+"="+value+";path=/" //cookie value is domain wide (path=/)
	}
	
	ddtabcontent.prototype={
	
		expandit:function(tabid_or_position){ //PUBLIC function to select a tab either by its ID or position(int) within its peers
			this.cancelautorun() //stop auto cycling of tabs (if running)
			var tabref=""
			try{
				if (typeof tabid_or_position=="string" && document.getElementById(tabid_or_position).getAttribute("rel")) //if specified tab contains "rel" attr
					tabref=document.getElementById(tabid_or_position)
				else if (parseInt(tabid_or_position)!=NaN && this.tabs[tabid_or_position].getAttribute("rel")) //if specified tab contains "rel" attr
					tabref=this.tabs[tabid_or_position]
			}
			catch(err){alert("Invalid Tab ID or position entered!")}
			if (tabref!="") //if a valid tab is found based on function parameter
				this.expandtab(tabref) //expand this tab
		},
	
		cycleit:function(dir, autorun){ //PUBLIC function to move foward or backwards through each hot tab (tabinstance.cycleit('foward/back') )
			if (dir=="next"){
				var currentTabIndex=(this.currentTabIndex<this.hottabspositions.length-1)? this.currentTabIndex+1 : 0
			}
			else if (dir=="prev"){
				var currentTabIndex=(this.currentTabIndex>0)? this.currentTabIndex-1 : this.hottabspositions.length-1
			}
			if (typeof autorun=="undefined") //if cycleit() is being called by user, versus autorun() function
				this.cancelautorun() //stop auto cycling of tabs (if running)
			this.expandtab(this.tabs[this.hottabspositions[currentTabIndex]])
		},
	
		setpersist:function(bool){ //PUBLIC function to toggle persistence feature
				this.enabletabpersistence=bool
		},
	
		setselectedClassTarget:function(objstr){ //PUBLIC function to set which target element to assign "selected" CSS class ("linkparent" or "link")
			this.selectedClassTarget=objstr || "link"
		},
	
		getselectedClassTarget:function(tabref){ //Returns target element to assign "selected" CSS class to
			return (this.selectedClassTarget==("linkparent".toLowerCase()))? tabref.parentNode : tabref
		},
	
		urlparamselect:function(tabinterfaceid){
			var result=window.location.search.match(new RegExp(tabinterfaceid+"=(\\d+)", "i")) //check for "?tabinterfaceid=2" in URL
			return (result==null)? null : parseInt(RegExp.$1) //returns null or index, where index (int) is the selected tab's index
		},
	
		expandtab:function(tabref){
			var subcontentid=tabref.getAttribute("rel") //Get id of subcontent to expand
			//Get "rev" attr as a string of IDs in the format ",john,george,trey,etc," to easily search through
			var associatedrevids=(tabref.getAttribute("rev"))? ","+tabref.getAttribute("rev").replace(/\s+/, "")+"," : ""
			this.expandsubcontent(subcontentid)
			this.expandrevcontent(associatedrevids)
			for (var i=0; i<this.tabs.length; i++){ //Loop through all tabs, and assign only the selected tab the CSS class "selected"
				this.getselectedClassTarget(this.tabs[i]).className=(this.tabs[i].getAttribute("rel")==subcontentid)? "selected" : ""
			}
			if (this.enabletabpersistence) //if persistence enabled, save selected tab position(int) relative to its peers
				ddtabcontent.setCookie(this.tabinterfaceid, tabref.tabposition)
			this.setcurrenttabindex(tabref.tabposition) //remember position of selected tab within hottabspositions[] array
		},
	
		expandsubcontent:function(subcontentid){
			for (var i=0; i<this.subcontentids.length; i++){
				var subcontent=document.getElementById(this.subcontentids[i]) //cache current subcontent obj (in for loop)
				subcontent.style.display=(subcontent.id==subcontentid)? "block" : "none" //"show" or hide sub content based on matching id attr value
			}
			if(subcontentid=="movie")
			{
			document.getElementById("movie_blue").style.display="";	
			document.getElementById("movie_gray").style.display="none";
			document.getElementById("cinema_blue").style.display="none";	
			document.getElementById("cinema_gray").style.display="";
			
			//document.getElementById("movie").style.display="";
			//document.getElementById("cinema").style.display="none";
			}
			else if(subcontentid=="cinema")
			{
			document.getElementById("cinema_blue").style.display="";	
			document.getElementById("cinema_gray").style.display="none";
			document.getElementById("movie_blue").style.display="none";	
			document.getElementById("movie_gray").style.display="";
			
			//document.getElementById("movie").style.display="none";
			//document.getElementById("cinema").style.display="";
			}
			//disabled for coming soon
			if(subcontentid=="movieNow")
			{
			document.getElementById("now-showing-active").style.display="";	
			document.getElementById("now-showing-normal").style.display="none";
			document.getElementById("comining-soon-active").style.display="none";	
			document.getElementById("comining-soon-normal").style.display="";
			
			//document.getElementById("movie").style.display="";
			//document.getElementById("cinema").style.display="none";
			}
			else if(subcontentid=="cinemaNow")
			{
			document.getElementById("comining-soon-active").style.display="";	
			document.getElementById("comining-soon-normal").style.display="none";
			document.getElementById("now-showing-active").style.display="none";	
			document.getElementById("now-showing-normal").style.display="";
			
			//document.getElementById("movie").style.display="none";
			//document.getElementById("cinema").style.display="";
			}
		},
	
		expandrevcontent:function(associatedrevids){
			var allrevids=this.revcontentids
			for (var i=0; i<allrevids.length; i++){ //Loop through rev attributes for all tabs in this tab interface
				//if any values stored within associatedrevids matches one within allrevids, expand that DIV, otherwise, contract it
				document.getElementById(allrevids[i]).style.display=(associatedrevids.indexOf(","+allrevids[i]+",")!=-1)? "block" : "none"
			}
		},
	
		setcurrenttabindex:function(tabposition){ //store current position of tab (within hottabspositions[] array)
			for (var i=0; i<this.hottabspositions.length; i++){
				if (tabposition==this.hottabspositions[i]){
					this.currentTabIndex=i
					break
				}
			}
		},
	
		autorun:function(){ //function to auto cycle through and select tabs based on a set interval
			this.cycleit('next', true)
		},
	
		cancelautorun:function(){
			if (typeof this.autoruntimer!="undefined")
				clearInterval(this.autoruntimer)
		},
	
		init:function(automodeperiod){
			var persistedtab=ddtabcontent.getCookie(this.tabinterfaceid) //get position of persisted tab (applicable if persistence is enabled)
			var selectedtab=-1 //Currently selected tab index (-1 meaning none)
			var selectedtabfromurl=this.urlparamselect(this.tabinterfaceid) //returns null or index from: tabcontent.htm?tabinterfaceid=index
			this.automodeperiod=automodeperiod || 0
			for (var i=0; i<this.tabs.length; i++){
				this.tabs[i].tabposition=i //remember position of tab relative to its peers
				if (this.tabs[i].getAttribute("rel")){
					var tabinstance=this
					this.hottabspositions[this.hottabspositions.length]=i //store position of "hot" tab ("rel" attr defined) relative to its peers
					this.subcontentids[this.subcontentids.length]=this.tabs[i].getAttribute("rel") //store id of sub content ("rel" attr value)
					this.tabs[i].onclick=function(){
						tabinstance.expandtab(this)
						tabinstance.cancelautorun() //stop auto cycling of tabs (if running)
						return false
					}
					if (this.tabs[i].getAttribute("rev")){ //if "rev" attr defined, store each value within "rev" as an array element
						this.revcontentids=this.revcontentids.concat(this.tabs[i].getAttribute("rev").split(/\s*,\s*/))
					}
					if (selectedtabfromurl==i || this.enabletabpersistence && selectedtab==-1 && parseInt(persistedtab)==i || !this.enabletabpersistence && selectedtab==-1 && this.getselectedClassTarget(this.tabs[i]).className=="selected"){
						selectedtab=i //Selected tab index, if found
					}
				}
			} //END for loop
			if (selectedtab!=-1) //if a valid default selected tab index is found
				this.expandtab(this.tabs[selectedtab]) //expand selected tab (either from URL parameter, persistent feature, or class="selected" class)
			else //if no valid default selected index found
				this.expandtab(this.tabs[this.hottabspositions[0]]) //Just select first tab that contains a "rel" attr
			if (parseInt(this.automodeperiod)>500 && this.hottabspositions.length>1){
				this.autoruntimer=setInterval(function(){tabinstance.autorun()}, this.automodeperiod)
			}
		} //END int() function
	
	} //END Prototype assignment
	
	function getXMLHTTP() { //fuction to return the xml http object
		var xmlhttp=false;	
		try{
			xmlhttp=new XMLHttpRequest();
		}
		catch(e)	{		
			try{			
				xmlhttp= new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch(e){
				try{
				xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
				}
				catch(e1){
					xmlhttp=false;
				}
			}
		}
		 	
		return xmlhttp;
	}
	

	function uploadTrailers(strURL) {
			
		var req = getXMLHTTP();
		
		if (req) {
			
			req.onreadystatechange = function() {
				if (req.readyState == 4) {
					// only if "OK"
					if (req.status == 200) {
						document.getElementById('trailers').innerHTML=req.responseText;	
						//alert(req.responseText);
					} else {
						alert("There was a problem while using XMLHTTP:\n" + req.statusText);
					}
				}				
			}			
			req.open("GET", strURL, true);
			req.send(null);
		}
				
	}
	

	function changeSelVall(id,val,url){
		
		var sel=document.getElementById(id);
		
		for(var i=0;i<sel.length;i++){
			if(sel[i].value==val){
				if(id=='cmbRegion'){
					loadMovies(val);
					loadMMDate();
					
				}
				if(id=='cmbCRegion'){
					loadVenus(val);
					loadMCDate();
				}				
				nowShowing(val,url);
				document.getElementById(id).selectedIndex=i;
			}
		}
		
	}
	function nowShowing(strRegion,url) {		
		
		arrSubLang= new Array();
		for(var i=0;i<arrSubRegion.length;i++){

			if(arrSubRegion[i][0].toLowerCase()==strRegion.toLowerCase()){
				arrSubLang[i]=arrSubRegion[i][3];		
			}
		}
		arrSubLang=unique(arrSubLang);
		var k=0;
		/*if(arrSubLang.length==1){
			k=0;
		}*/
		if(arrSubLang[0]==undefined){
			k=1;
		}
		var strAllDis="";
		for(var j=k;j<arrSubLang.length;j++){
							
			strAllDis=strAllDis+"<div class='PaddingBottom10 rowdiv'><h6 >"+arrSubLang[j]+"</h6>";
			var strDD=checkN(strRegion,arrSubLang[j],url);
			strAllDis=strAllDis+strDD;
			strAllDis=strAllDis+"</div>";
		}
		if(document.getElementById('movieNow')){
		document.getElementById('movieNow').innerHTML=strAllDis;}
	}
	function checkN(strRegion,strLangu,url){
		
		arrMovies=new Array();
		for(var i=0;i<arrSubRegion.length;i++){

			if(arrSubRegion[i][0].toLowerCase()==strRegion.toLowerCase()){
				if(arrSubRegion[i][3]==strLangu){
				arrMovies.push(new Array(arrSubRegion[i][2],arrSubRegion[i][1]));}
			}
		}
		var strDis="<ul>";		
		var num=Math.ceil(arrMovies.length/2);
						
		for(var i=0;i<arrMovies.length;i++){

			if(i<num){
								
				strDis=strDis+'<li><a href="'+url+'/movie_description.php?id='+arrMovies[i][1]+'">'+arrMovies[i][0]+'</a></li>';
			}else{
				if(i==num){
					strDis=strDis+'</ul><ul>';
				}
				strDis=strDis+'<li><a href="'+url+'/movie_description.php?id='+arrMovies[i][1]+'">'+arrMovies[i][0]+'</a></li>';
			}							
		}
		strDis=strDis+'</ul>';
		return strDis;
	}
	function loadError(){
		document.getElementById('tabss').innerHTML='We are updating. Please try after some time or call 040-45678910 for assistance';
		document.getElementById('tabss').style.height='73px';
		document.getElementById('tabss').style.fontSize='15px';
		document.getElementById('tabss').style.color='brown';
		document.getElementById('tabss').style.paddingTop='30px';
	}
	function loadError1(){
		document.getElementById('tabs').innerHTML='We are updating. Please try after some time or call 040-45678910 for assistance';
		document.getElementById('tabs').style.height='73px';
		document.getElementById('tabs').style.fontSize='14px';
		document.getElementById('tabs').style.color='brown';
		document.getElementById('tabs').style.paddingTop='55px';
		document.getElementById('tabs').style.paddingLeft='5px';
	}
	function loadRegions(strRegion) {		
		
		document.getElementById('cmbRegion').innerHTML=null;
		document.getElementById('cmbRegion').options[0]=new Option('Select Region','');
		
		for(var j=0;j<arrRegion.length;j++){
			
			document.getElementById('cmbRegion').options[document.getElementById('cmbRegion').options.length]=new Option(arrRegion[j][1],arrRegion[j][0]);
			
			if(arrRegion[j][0].toLowerCase()==strRegion.toLowerCase()){
				
				document.getElementById('cmbRegion').selectedIndex=document.getElementById('cmbRegion').options.length-1;
			}
		}
		document.getElementById('cmbCRegion').innerHTML=null;
		document.getElementById('cmbCRegion').options[0]=new Option('Select Region','');
		
		for(var j=0;j<arrRegion.length;j++){
			
			document.getElementById('cmbCRegion').options[document.getElementById('cmbCRegion').options.length]=new Option(arrRegion[j][1],arrRegion[j][0]);
			
			if(arrRegion[j][0].toLowerCase()==strRegion.toLowerCase()){
				
				document.getElementById('cmbCRegion').selectedIndex=document.getElementById('cmbCRegion').options.length-1;
			}
		}
				
	}

	function loadMovies(strRegion) {		
		
		document.getElementById('cmbVenue').innerHTML=null;
		document.getElementById('cmbVenue').options[0]=new Option('Select Movie','');
		var oSelect = document.getElementById('cmbVenue');
		arrSubLang= new Array();
		for(var i=0;i<arrSubRegion.length;i++){

			if(arrSubRegion[i][0].toLowerCase()==strRegion.toLowerCase()){
				arrSubLang[i]=arrSubRegion[i][3];		
			}
		}
		arrSubLang=unique(arrSubLang);
		var k=0;
		/*if(arrSubLang.length>1){
			k=1;
		}*/
		if(arrSubLang[0]==undefined){
			k=1;
		}
		for(var j=k;j<arrSubLang.length;j++){
							
			var oGroup = document.createElement('OPTGROUP');
			oGroup.label = arrSubLang[j];							
			oSelect.appendChild(oGroup);
			
			for(var i=0;i<arrSubRegion.length;i++){

				if(arrSubRegion[i][0].toLowerCase()==strRegion.toLowerCase()){
					if(arrSubRegion[i][3]==arrSubLang[j]){
						
						document.getElementById('cmbVenue').options[document.getElementById('cmbVenue').options.length]=new Option(arrSubRegion[i][2],arrSubRegion[i][1]);
					}
				}
			}
		}
		
	}
	function unique(arrayName) {
	
		var newArray=new Array();
		label:for(var i=0; i<arrayName.length;i++ )
		{  
			for(var j=0; j<newArray.length;j++ )
			{
				if(newArray[j]==arrayName[i]) 
					continue label;
			}
			newArray[newArray.length] = arrayName[i];
		}
		return newArray;
	}
	
	function loadMDate(strVenu,strRegion) {		
		var strURL='/movie_config/getMDate.php?strRegion='+strRegion+'&strVenu='+strVenu;
		var req = getXMLHTTP();
		
		if (req) {
			
			req.onreadystatechange = function() {
				if (req.readyState == 4) {
					// only if "OK"
					
					if (req.status == 200) {
						
						var arrMDates=req.responseText.split(",");
						
						document.getElementById('cmbDate').innerHTML=null;
						document.getElementById('cmbDate').options[0]=new Option('Select Date','');
						for(var i=1;i<arrMDates.length;i++){
							var newVal=arrMDates[i].split("@");
							
							document.getElementById('cmbDate').options[document.getElementById('cmbDate').options.length]=new Option(newVal[1],newVal[0]);
						}

						//document.getElementById('cmbDate').innerHTML=req.responseText;	
						
					} else {
						alert("There was a problem while using XMLHTTP:\n" + req.statusText);
					}
				}				
			}			
			req.open("GET", strURL, true);
			req.send(null);
		}				
	}
	function loadMMDate() {		
		
		document.getElementById('cmbDate').innerHTML=null;
		document.getElementById('cmbDate').options[0]=new Option('Select Date','');
	}
	function loadMTime(strVenu,strRegion,strDate) {		
		var strURL='/movie_config/getMTime.php?strRegion='+strRegion+'&strVenu='+strVenu+'&strDate='+strDate;
		var req = getXMLHTTP();
		
		if (req) {
			
			req.onreadystatechange = function() {
				if (req.readyState == 4) {
					// only if "OK"
					
					if (req.status == 200) {
						document.getElementById('all').innerHTML=req.responseText;	
						
					} else {
						alert("There was a problem while using XMLHTTP:\n" + req.statusText);
					}
				}				
			}			
			req.open("GET", strURL, true);
			req.send(null);
		}				
	}
	function loadVenus(strRegion) {		
		
		document.getElementById('cmbEvent').innerHTML=null;
		document.getElementById('cmbEvent').options[0]=new Option('Select Cinema','');
		
		for(var i=0;i<arrVenu.length;i++){
			if(arrVenu[i][0].toLowerCase()==strRegion.toLowerCase()){

				document.getElementById('cmbEvent').options[document.getElementById('cmbEvent').options.length]=new Option(arrVenu[i][2],arrVenu[i][1]);
			}
		}
				
	}
	
	function loadMCDate() {		
		
		document.getElementById('cmbCDate').innerHTML=null;
		document.getElementById('cmbCDate').options[0]=new Option('Select Date','');
	}
	function loadCDate(strVenu,strRegion) {		
		var strURL='/movie_config/getCDate.php?strRegion='+strRegion+'&strEvent='+strVenu;
		var req = getXMLHTTP();
		
		if (req) {
			
			req.onreadystatechange = function() {
				if (req.readyState == 4) {
					// only if "OK"
					
					if (req.status == 200) {
						
						var arrCDates=req.responseText.split(",");
						
						document.getElementById('cmbCDate').innerHTML=null;
						document.getElementById('cmbCDate').options[0]=new Option('Select Date','');
						for(var i=1;i<arrCDates.length;i++){
							var newVal=arrCDates[i].split("@");
							document.getElementById('cmbCDate').options[document.getElementById('cmbCDate').options.length]=new Option(newVal[1],newVal[0]);
						}						
						
					} else {
						alert("There was a problem while using XMLHTTP:\n" + req.statusText);
					}
				}				
			}			
			req.open("GET", strURL, true);
			req.send(null);
		}				
	}
	function loadCTime(strVenu,strRegion,strDate) {		
		var strURL='/movie_config/getCTime.php?strRegion='+strRegion+'&strVenu='+strVenu+'&strDate='+strDate;
		var req = getXMLHTTP();
		
		if (req) {
			
			req.onreadystatechange = function() {
				if (req.readyState == 4) {
					// only if "OK"
					
					if (req.status == 200) {
						document.getElementById('all').innerHTML=req.responseText;	
						
					} else {
						alert("There was a problem while using XMLHTTP:\n" + req.statusText);
					}
				}				
			}			
			req.open("GET", strURL, true);
			req.send(null);
		}				
	}
	function loadPMDate(strVenu,strRegion) {		
		var strURL='/movie_config/getMDate.php?strRegion='+strRegion+'&strVenu='+strVenu;
		var req = getXMLHTTP();
		
		if (req) {
			
			req.onreadystatechange = function() {
				if (req.readyState == 4) {
					// only if "OK"
					
					if (req.status == 200) {
						
						var arrMDates=req.responseText.split(",");
						
						document.getElementById('cmbDate').innerHTML=null;
						document.getElementById('cmbDate').options[0]=new Option('Select Date','');
						for(var i=1;i<arrMDates.length;i++){
							var newVal=arrMDates[i].split("@");
							document.getElementById('cmbDate').options[document.getElementById('cmbDate').options.length]=new Option(newVal[1],newVal[0]);
						}

						//document.getElementById('cmbDate').innerHTML=req.responseText;	
						
					} else {
						alert("There was a problem while using XMLHTTP:\n" + req.statusText);
					}
				}				
			}			
			req.open("GET", strURL, true);
			req.send(null);
		}				
	}
	
	function subSelectShow(strVenueCode, strSessionId, strEventCode, strDateCode, strSelectedSubRegionCode){
	
		var strIBURL = "http://in.bookmyshow.com/booktickets/?utm_medium=strMedium&utm_source=YRCH&utm_campaign=&cid=" + strVenueCode + "&sid=" + strSessionId + "&eid=" + strEventCode + "&did=" + strDateCode + "&srid=" + strSelectedSubRegionCode+"&ety=&utm_content=";
		window.open(strIBURL, "BookMyShow", "center=yes, status=yes, toolbar=yes, location=yes, menubar=yes, scrollbars=yes, resizable=yes");
	} 
	
	function frmSubmitM(strMovie,strRegion,strDate) {	
		if(strDate){
		var strURL='/movie_config/getMTime.php?strRegion='+strRegion+'&strMovie='+strMovie+'&strDate='+strDate;
		var req = getXMLHTTP();
		
		if (req) {
			
			req.onreadystatechange = function() {
				if (req.readyState == 4) {
					// only if "OK"
					
					if (req.status == 200) {
						document.getElementById('discription-pan').innerHTML=req.responseText;	
						
					} else {
						alert("There was a problem while using XMLHTTP:\n" + req.statusText);
					}
				}				
			}			
			req.open("GET", strURL, true);
			req.send(null);
		}	
		}
	}
	function frmSubmitC(strVenu,strRegion,strDate) {
		if(strDate){
		var strURL='/movie_config/getCTime.php?strRegion='+strRegion+'&strVenu='+strVenu+'&strDate='+strDate;
		var req = getXMLHTTP();
		
		if (req) {
			
			req.onreadystatechange = function() {
				if (req.readyState == 4) {
					// only if "OK"
					
					if (req.status == 200) {
						document.getElementById('discription-pan').innerHTML=req.responseText;	
						
					} else {
						alert("There was a problem while using XMLHTTP:\n" + req.statusText);
					}
				}				
			}			
			req.open("GET", strURL, true);
			req.send(null);
		}	
		}
	}

	function frmSubmit(val)
	{
		var dateT="";
		if(val == 'movie')
		{
			var regval = document.getElementById("cmbRegion").value; 
			var movval = document.getElementById("cmbVenue").value;
			var datval = document.getElementById("cmbDate").value; 
			document.frm.regVal.value = regval;
			document.frm.movVal.value = movval;
			document.frm.datVal.value = datval;
			document.frm.cinVal.value = '';
			dateT=datval;
		}
		else if(val == 'cinema')
		{
			var regcinemaval = document.getElementById("cmbCRegion").value; 
			var vencinemaval = document.getElementById("cmbEvent").value;
			var datcinemaval = document.getElementById("cmbCDate").value; 
			document.frm.regVal.value = regcinemaval;
			document.frm.cinVal.value = vencinemaval;
			document.frm.datVal.value = datcinemaval;
			document.frm.movVal.value = '';
			dateT=datcinemaval;
		}
		
		if(dateT){
		document.frm.action = "/movie/book_tickets.php";
		document.frm.submit();}
	}
	function mebfrmSubmit(val)
	{
		var dateT="";
		if(val == 'movie')
		{
			var regval = document.getElementById("cmbRegion").value; 
			var movval = document.getElementById("cmbVenue").value;
			var datval = document.getElementById("cmbDate").value; 
			document.frm.regVal.value = regval;
			document.frm.movVal.value = movval;
			document.frm.datVal.value = datval;
			document.frm.cinVal.value = '';
			dateT=datval;
		}
		if(val == 'cinema')
		{
			var regcinemaval = document.getElementById("cmbCRegion").value; 
			var vencinemaval = document.getElementById("cmbEvent").value;
			var datcinemaval = document.getElementById("cmbCDate").value; 
			document.frm.regVal.value = regcinemaval;
			document.frm.cinVal.value = vencinemaval;
			document.frm.datVal.value = datcinemaval;
			document.frm.movVal.value = '';
			dateT=datcinemaval;
		}
		
		if(dateT){
		document.frm.action = "/members/movie/book_tickets.php";
		document.frm.submit();}
	}
	function MyGetUrlParams(){
	  var url_params = false;
	  var urla = location.href.substring(location.href).split('/');
	  for(i=0;i< urla.length ;i++){
		  
		if(urla[3]=='index.php' || urla[3]==''){
			
			url_params=true;
		}
	  }
	 
	  return url_params;
	}

	
	function validate_form()
	{
	    document.getElementById('errors').innerHTML = "";
	    var err_flag = 0;
		if(document.getElementById('name').value=="")
		{
			document.getElementById('errors').style.display="";
			document.getElementById('errors').innerHTML="Please Enter Name";
			err_flag = 1;
		}
		if(document.getElementById('title').value=="")
		{
			document.getElementById('errors').style.display="";
			document.getElementById('errors').innerHTML+="<br/>Please Enter Title For Review";
			err_flag = 1;
		}
		if(document.getElementById('review').value=="")
		{
			document.getElementById('errors').style.display="";
			document.getElementById('errors').innerHTML+="<br/>Please Enter Review";
			err_flag = 1;
		}
		if(err_flag == 0)
		{
			document.review_frm.submit();
		}
	}

	function validate_trailer_form()
	{
		document.getElementById('errors').innerHTML = "";
		var err_flag = 0;
	        if(document.getElementById('name').value=="")
		{
			document.getElementById('errors').style.display="";
			document.getElementById('errors').innerHTML="<br/>Please Enter Name";
			err_flag = 1;
		}
		if(document.getElementById('video').value=="")
		{
			document.getElementById('errors').style.display="";
			document.getElementById('errors').innerHTML="<br/>Please Copy Video Snippet";
			err_flag = 1;
		}
		if(err_flag == 0)
		{
			document.trailer_frm.submit();
		}
	}
		
	function validate_desc_form()
	{
		if(document.getElementById('cmbRegion').value=="Select Region" || document.getElementById('cmbRegion').value=="")
		{
			alert("Please Select Region");
			return false
		} 
		else if(document.getElementById('cmbDate').value=="Select Date" || document.getElementById('cmbDate').value=="")
		{
			alert("Please Select Date");
			return false
		}
		else
		{
			//document.frm.action = "book_tickets.php";
			document.frm.submit();
		}
	}

	function filterShow(strURL) {		
		
		var req = getXMLHTTP();
		
		if (req) {
			
			req.onreadystatechange = function() {
				if (req.readyState == 4) {
					// only if "OK"
					if (req.status == 200) {						
						document.getElementById('showTime').innerHTML=req.responseText;						
					} else {
						alert("There was a problem while using XMLHTTP:\n" + req.statusText);
					}
				}				
			}			
			req.open("GET", strURL, true);
			req.send(null);
		}
				
	}

	function selectDiv(selVal,rVal)
	{
		if(selVal == 'movie')
		{
			document.getElementById('radmovieVal').checked = true; 	
			document.getElementById('radcinemaVal').checked = false;

			document.getElementById('movie').style.display = "";
			document.getElementById('cinema').style.display = "none";
			if(rVal){
				loadMovies(rVal);
			}
		}
		else if(selVal == 'cinema')
		{
			document.getElementById('radmovieVal').checked = false; 	
			document.getElementById('radcinemaVal').checked = true;

			document.getElementById('movie').style.display = "none";
			document.getElementById('cinema').style.display = "";
			if(rVal){
				loadVenus(rVal);
			}
		}
		
		document.getElementById('cmbDate').innerHTML=null;
		document.getElementById('cmbDate').options[0]=new Option('Select Date','');
		document.getElementById('cmbCDate').innerHTML=null;
		document.getElementById('cmbCDate').options[0]=new Option('Select Date','');
		
	}
	function checkTestDone(){
		if(document.getElementById('loadingM')){
    document.getElementById('loadingM').style.display='none';}
    
    }

	function MM_swapImgRestore() { //v3.0
		var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
	}
	
	function MM_preloadImages() { //v3.0
		var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
		var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
		if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
	}
	
	function MM_findObj(n, d) { //v4.01
		var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
		d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
		if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
		for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
		if(!x && d.getElementById) x=d.getElementById(n); return x;
	}
	
	function MM_swapImage() { //v3.0
		var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
		if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
	}
//////////////////////////////////mouseover//////////////////////////////
function movepic(img_name,img_src) {
//document[img_name].src=img_src;
document.getElementById(img_name).src=img_src;
}
function getLeaderBoard(id,cid,ii) {
		
		var strURL='/getLeaderBoard.php?id='+id;
		var req = getXMLHTTP();
		
		if (req) {
			
			req.onreadystatechange = function() {
				if (req.readyState == 4) {
					// only if "OK"
					
					if (req.status == 200) {
						document.getElementById('LeaderBoard').innerHTML=req.responseText;	
						for(var i=1;i<=cid;i++){
							
							if(i==ii){

								document.getElementById('LB'+i).className='cur';	
							}else{
								document.getElementById('LB'+i).className='';	
							}
						}
						
					} else {
						alert("There was a problem while using XMLHTTP:\n" + req.statusText);
					}
				}				
			}			
			req.open("GET", strURL, true);
			req.send(null);
		}	
		}