var domain="tomar.biz";
var path="/";
var file="";
var doget_sting="";
var doget_array=null;
var location_toHTML="";

function set_location(domain,path,file,doget_string){
	if (doget_string!=null){
		self.location="http://"+domain+"/"+path+"/"+file+"?"+doget_string;
	}else{
		self.location="http://"+domain+"/"+path+"/"+file;
	}
}
function string_start(string,at_sting){
		return at_sting.indexOf(string);
}
function string_end(string,at_sting){
		return at_sting.indexOf(string)+string.length-1;
}
function last_string_start(string,at_sting){
		return at_sting.lastIndexOf(string);
}
function last_string_end(string,at_sting){
		return at_sting.lastIndexOf(string)+string.length-1;
}
function get_location(){
		this_location=self.location+"";
		location_cut=self.location+"";
		domain_start=	string_end	("http://",location_cut);
		location_cut=location_cut.substring(domain_start,this_location.length);
		domain_end=	domain_start+string_start	 ("/",location_cut);
		domain=this_location.substring(domain_start,domain_end);

		location_cut=this_location.substring(domain_end,this_location.length);
		path_start=	domain_end+1;
		location_cut=this_location.substring(path_start,this_location.length);
		if (last_string_end	 ("/",location_cut)!=-1){
			path_end=	path_start+last_string_end	 ("/",location_cut);
			path=this_location.substring(path_start,path_end);

			location_cut=this_location.substring(path_end,this_location.length);
			file_start=	path_end+1;
			if (string_start	 ("?",location_cut)!=-1){
				file_end=	file_start+string_end	 ("?",location_cut)-1;
				file=this_location.substring(file_start,file_end);

				doget_sting_start=file_end+1;
				doget_sting_end=this_location.length;
				doget_sting=
				doget_sting=this_location.substring(doget_sting_start,doget_sting_end);
			}else{
				file_end=this_location.length;
				file=this_location.substring(file_start,file_end);
				doget_sting="";
			}
		}else{
			path_end=path_start;
			path="/";

			location_cut=this_location.substring(path_end,this_location.length);
			file_start=	path_end;
			if (string_start	 ("?",location_cut)!=-1){
				file_end=	file_start+string_end	 ("?",location_cut);
				file=this_location.substring(file_start,file_end);

				doget_sting_start=file_end+1;
				doget_sting_end=this_location.length;
				doget_sting=
				doget_sting=this_location.substring(doget_sting_start,doget_sting_end);
			}else{
				file_end=this_location.length;
				file=this_location.substring(file_start,file_end);
				doget_sting="";
			}
		}
	if (doget_sting!=""){
		doget_array=doget_sting.split("&");
	}else{
		doget_array=null;
	}
	
}
function show_location(){
	document.write(get_location_toHTML());
}
function get_location_toHTML(){
	if (doget_sting!=""){
		location_toHTML="domain="+domain+"<BR>"
		+"path="+path+"<BR>"
		+"file="+file+"<BR>"
		+"doget_sting="+doget_sting;
		for (at=0;at<doget_array.length;at++ ){
			location_toHTML=location_toHTML+"<BR>doget_array["+at+"]= "+doget_array[at];
		}
	}else{
		location_toHTML="domain="+domain+"<BR>"
		+"path="+path+"<BR>"
		+"file="+file+"<BR>";
	}
	return location_toHTML;
}
/*
				location_cut=this_location.substring(get_sting_start,this_location.length);
				if (string_start	 ("&",location_cut)!=-1){
					while (string_start	 ("&",location_cut)!=-1){
						doget_sting_start=file_end+1;
						doget_sting_end=string_end	 ("&",location_cut);
						doget_sting=
						alert("this_location="+self.location+"\n"
						+"location_cut="+location_cut+"\n"
						+"doget_sting_start="+get_sting_start+"\n"
						+"doget_sting_end="+doget_sting_end+"\n"
						+"file="+file+"\n"
						);
					}
				}else{
				alert("this_location="+self.location+"\n"
					+"location_cut="+location_cut+"\n"
					+"get_sting_start="+get_sting_start+"\n"
					+"doget_sting_end="+doget_sting_end+"\n"
					+"file_end="+file_end+"\n"
					+"file="+file+"\n"
					);
				}
				*/
