////////////////////////////// Change_language //////////////





function getDirPathhome(){
var Vdir =	cuttexitcutto(document.URL,'/') +'index.php?dir='+$('select#Language_d').val();
	 top.location = Vdir;
} 



/*

function cuttexitcutto(textval,endcut){
 var x='';
 for (var l =0 ; l <= textval.length ; l++)
	 {
	   if(textval.charAt(l)== endcut)
	   {
        break;
	   }
      x +=textval.charAt(l);   
	}
	 return x;
}
*/

function getDirPath(URL) { 
    var result = unescape(URL.substring(0,(URL.lastIndexOf("/")) + 1)); 
    return result; 
} 

function getDirPath2(URL) { 
    var result = unescape(URL.substring(0,(URL.lastIndexOf("?")) + 1)); 
    return result; 
}

 





function Variable_language_ATION(val_this){

var URL_P = document.URL;
//var u =  cuttexitcutto(m,'?','language='); 
 //var u = m.replace("language=en", "")
//alert(Variable_language)
var URL_N = URL_P.replace(Variable_language, "")

var Vdir = URL_N+'&language='+val_this;
//URL = URL_P
var URL_P_slach = getDirPath(URL_P)
var empty_index = getDirPath2(URL_P)

 Vdir = Vdir.replace("&&", "&"); 
 // alert(URL_P.lastIndexOf("/"));
 //textval.length
 //alert(Vdir)
 	//var result = unescape(URL.substring(0,(20) + 1)); 
//alert(f)
 if(empty_index =='')
 {
  //alert(URL_P_slach+'index.php?')
  top.location = URL_P_slach+'index.php?language='+val_this;
  }else if(empty_index !='')
  {
  top.location = Vdir;
  }
}



 

function sendData(dat)
{
  //alert(window.location.search)
  window.location.search = dat;
  
 // top.location=dat;
//  alert(window.location.search)

 


 

//window.stop();
 // window.location.reload( false );
 return false; 
  //alert(push(window.location.search))
  //alert(window.location.search)
}
//in html: <button onclick="return sendData('Somedata=mmmmmm&vvvv=mmm');">Send data</button><br />
// <a href="javascript:void(0)" onclick="return sendData('Somedata=mmmmmm&vvvv=mmm');">go</a><br />
//  <a href="javascript:sendData('Somedata=mmmmmm&vvvv=mmm');" >go</a><br />
