// JavaScript Document
//------------------------------------------------------------------------------
//jump to page
function selecturl(home,url,s) 
{
  var gourl = s.options[s.selectedIndex].value;
  
  var jump = home + '?change_currency='+ gourl+"&url="+ url;
    
  if ((gourl != null) && (gourl != '') )
  {
    window.top.location.href = jump;
  }
}

//------------------------------------------------------------------------------
function openimg(file, width, height){
  mywindow = window.open (file,"fotowindow","menubar=0,resizable=1,scrollbars=1,width="+width+",height="+height+"");
  mywindow.moveTo(((screen.width/2)-(width/2)),((screen.height/2)-(height/2)));
  return false;
}

//------------------------------------------------------------------------------
function selecturl2(url,s,g) 
{
  var gourl = s.options[s.selectedIndex].value;
  
  var jump = url + g + gourl;
    
  if ((gourl != null) && (gourl != '') )
  {
    window.top.location.href = jump;
  }
}

//------------------------------------------------------------------------------
function SetAllCheckBoxes(FormName, FieldName, CheckValue)
{
	if(!document.forms[FormName])
		return;
	var objCheckBoxes = document.forms[FormName].elements[FieldName];
	if(!objCheckBoxes)
		return;
	var countCheckBoxes = objCheckBoxes.length;
	if(!countCheckBoxes)
		objCheckBoxes.checked = CheckValue;
	else
		// set the check value for all check boxes
		for(var i = 0; i < countCheckBoxes; i++)
			objCheckBoxes[i].checked = CheckValue;
}

//------------------------------------------------------------------------------
function jumpto(jump){
  window.top.location.href = jump;
}

//------------------------------------------------------------------------------
function check_altele(){
  for( i = 0; i < document.cgo.faddress.length; i++ ){
    if(document.cgo.faddress[i].checked == true)return document.cgo.faddress[i].value;
  }
}

//------------------------------------------------------------------------------
function altele(w){
  var x = check_altele();
  if(x == "altele"){
    if(confirm("Datele de facturare vor fi pierdute. Continuati?")){jumpto(w);}
  }
  else{jumpto(w);}
}

//------------------------------------------------------------------------------
function search(field,field_txt){
  if(field.value == field_txt)field.select();
}



