// JScript source code
var curURL = new String(location.search);
	
	
	function locationFunctions(){
		this.getParamValueByName = getParamValueByName;
		this.getParamIndexByName = getParamIndexByName;
		this.setParamValueByName = setParamValueByName;
		this.reloadPage = reloadPage;
	}
	
	
	function getParamValueByName(){
		s = curURL.indexOf(this.param);
		if(s==-1){
			alert("not found");
		}
		else{
			var start = curURL.indexOf("=",s);
			var end = curURL.indexOf("&",start);
			if(end == -1){
				end = curURL.length;
			}
			var value = unescape(curURL.substring(start+1,end));
			alert(value);
		}
		
	}
	
	function getParamIndexByName(){
		s = curURL.indexOf(this.param);
		this.startParamIndex = s;
		if(s==-1){
			this.error = 1;
		}
		else{
			this.error = 0;
			var start = curURL.indexOf("=",s);
			
			var end = curURL.indexOf("&",start);
			if(end == -1){
				end = curURL.length;
			}
			this.startIndex = start + 1;
			this.endIndex = end;
		}
	}
	
	
	function setParamValueByName(newValue){
		var value = unescape(curURL.substring(this.startIndex,this.endIndex));
		var wholeparam = unescape(curURL.substring(this.startParamIndex,this.endIndex));
		var splitwholeparam = wholeparam.split("=");
		
		rep = curURL.replace(wholeparam,splitwholeparam[0] + "=" + newValue);
		this.newURL = rep;
	}
	
	function reloadPage(prm,newvalue,fl)
	{		
		this.param = prm;
		this.getParamIndexByName();
		this.setParamValueByName(newvalue);
		//var specialization = document.getElementById("ListHall_artistList").options[document.getElementById("ListHall_artistList").options.selectedIndex].value;
		var rparam = "";
		
		if(!this.error){
			rparam = this.newURL;
		}
		else{
			rparam = "?" + this.param + "=" + newvalue
		}
		
		document.forms[0].action=rparam;
		document.forms[0].submit();
		//location.href = rparam;		
	}
	function getParamIndexByName2(){
		s = newURL.indexOf(this.param);
		this.startParamIndex = s;
		if(s==-1){
			this.error = 1;
		}
		else{
			this.error = 0;
			var start = newURL.indexOf("=",s);
			
			var end = newURL.indexOf("&",start);
			if(end == -1){
				end = curURL.length;
			}
			this.startIndex = start + 1;
			this.endIndex = end;
		}
	}
		
	function setParamValueByName2(newValue){
		var value = unescape(newURL.substring(this.startIndex,this.endIndex));
		var wholeparam = unescape(newURL.substring(this.startParamIndex,this.endIndex));
		var splitwholeparam = wholeparam.split("=");
		
		rep = newURL.replace(wholeparam,splitwholeparam[0] + "=" + newValue);
		this.newURL = rep;
	}
	function reloadPage2(prm1,newvalue1,prm2,newvalue2)
	{	
		var rparam = "";
			
		this.param = prm1;
		this.getParamIndexByName();
		this.setParamValueByName(newvalue1);
		//var specialization = document.getElementById("ListHall_artistList").options[document.getElementById("ListHall_artistList").options.selectedIndex].value;
			
		if(!this.error){
			rparam = this.newURL;
		}
		else{
			rparam = "?" + this.param + "=" + newvalue1
		}
		
		this.param = prm2;
		this.getParamIndexByName2();
		this.setParamValueByName2(newvalue2);
		//var specialization = document.getElementById("ListHall_artistList").options[document.getElementById("ListHall_artistList").options.selectedIndex].value;
			
		if(!this.error){
			rparam = this.newURL;
		}
		else{
			rparam = "?" + this.param + "=" + newvalue2
		}
		var regExpLetter = /\&Letter\=.{1}/gi;
		var paramnoletter = new String(rparam);
		var letterpos = paramnoletter.replace(regExpLetter,"");
		
		
		document.forms[0].action=letterpos;
		document.forms[0].submit();
		//location.href = rparam;		
	}
	function reloadPageLabel(prm,newvalue,fl)
	{		
		this.param = prm;
		this.getParamIndexByName();
		this.setParamValueByName(newvalue);
		//var specialization = document.getElementById("ListHall_artistList").options[document.getElementById("ListHall_artistList").options.selectedIndex].value;
		var rparam = "";
		
		if(!this.error){
			rparam = this.newURL;
		}
		else{
			rparam = "?" + this.param + "=" + newvalue
		}
		
		document.forms[0].action=rparam+"#rr";
		document.forms[0].submit();
		//location.href = rparam;		
	}
	function reloadArea(Area,Page)
	{ var pref="",prefC="";
	
	if (Page=='HP') 
	  { pref="EventScheduleAllB1_"; prefC="FilmListHome1_"; }
	if (Page=='SU') 
		{ pref="EventScheduleOne1_";prefC="FilmListSubject1_"; }
	if (Page=='ED') 
		{ pref="EventScheduleDay1_";prefC="FilmListDay1_"; }
	if (Page=='CI') 
		{ pref="CinemaArea1_";prefC="FilmListDay1_"; }
	if (Page=='CH') 
	  { pref="AreaChoose1_"; prefC="FilmListHome1_"; }
	document.getElementById(pref+"TDSouth").className="EventsMidTableTitB";
	document.getElementById(pref+"TDIrushaliem").className="EventsMidTableTitB";
	document.getElementById(pref+"TDNorth").className="EventsMidTableTitB";
	document.getElementById(pref+"TDHaifa").className="EventsMidTableTitB";
	document.getElementById(pref+"TDCenter").className="EventsMidTableTitB";
	document.getElementById(pref+"TDTelAviv").className="EventsMidTableTitB";
	document.getElementById(pref+"TDunderSouth").className="EventsMidTableTitB";
	document.getElementById(pref+"TDunderIrushaliem").className="EventsMidTableTitB";
	document.getElementById(pref+"TDunderNorth").className="EventsMidTableTitB";
	document.getElementById(pref+"TDunderHaifa").className="EventsMidTableTitB";
	document.getElementById(pref+"TDunderCenter").className="EventsMidTableTitB";
	document.getElementById(pref+"TDunderTelAviv").className="EventsMidTableTitB";
	
	switch (Area)
	{
	case '1':
	document.getElementById(pref+"TDTelAviv").className="EventsMidTableTitBR";
	document.getElementById(pref+"TDunderTelAviv").className="EventsMidTableTitBR";
	break;	
	case '2':
	document.getElementById(pref+"TDCenter").className="EventsMidTableTitBR";
	document.getElementById(pref+"TDunderCenter").className="EventsMidTableTitBR";
	break;
	case '3':
	document.getElementById(pref+"TDHaifa").className="EventsMidTableTitBR";
	document.getElementById(pref+"TDunderHaifa").className="EventsMidTableTitBR";
	break;
	case '4':
	document.getElementById(pref+"TDNorth").className="EventsMidTableTitBR";
	document.getElementById(pref+"TDunderNorth").className="EventsMidTableTitBR";
	break;
	case '5':
	document.getElementById(pref+"TDIrushaliem").className="EventsMidTableTitBR";
	document.getElementById(pref+"TDunderIrushaliem").className="EventsMidTableTitBR";
	break;
	case '6':
	document.getElementById(pref+"TDSouth").className="EventsMidTableTitBR";
	document.getElementById(pref+"TDunderSouth").className="EventsMidTableTitBR";
	break;
	}					
	if ((Page!='CI') && (Page!='CH'))
	{
	document.getElementById(pref+"Tab1").style.display="none";	
	document.getElementById(pref+"Tab2").style.display="none";	
	document.getElementById(pref+"Tab3").style.display="none";	
	document.getElementById(pref+"Tab4").style.display="none";	
	document.getElementById(pref+"Tab5").style.display="none";	
	document.getElementById(pref+"Tab6").style.display="none";	
	document.getElementById(pref+"Tab"+Area).style.display="";	
	}
	
	document.getElementById(prefC+"Tab1").style.display="none";	
	document.getElementById(prefC+"Tab2").style.display="none";	
	document.getElementById(prefC+"Tab3").style.display="none";	
	document.getElementById(prefC+"Tab4").style.display="none";	
	document.getElementById(prefC+"Tab5").style.display="none";	
	document.getElementById(prefC+"Tab6").style.display="none";	
	document.getElementById(prefC+"Tab"+Area).style.display="";		
	}
	
	function GoOtherPage(PageName,AdvanceParam)
	{		
		var newURL = "";
		var curParam = new String(location.search);
	
	  if(curParam=="")	
			{ newURL = PageName + "?" + AdvanceParam }
		else
		  { newURL = PageName + curURL + "&" + AdvanceParam }
		
		document.location.href=newURL;
	}
	function GoNewURL(PageName,Params)
	{	var newURL = "";
		
		newURL = PageName + "?" + Params;
		document.location.href=newURL;
	}