function popup(URL) {
aWindow=window.open(URL,"Large","toolbar=no,width=420,height=300,status=no,scrollbars=no,resize=no,menubars=no");
}
function popup2(URL) {
aWindow=window.open(URL,"Large","toolbar=no,width=800,height=720,status=no,scrollbars=no,resize=no,menubars=no");
}
function contacteaza(URL) {
aWindow=window.open(URL,"Large","toolbar=no,width=420,height=400,status=no,scrollbars=no,resize=no,menubars=no");
}
function trimite_cerere(URL) {
aWindow=window.open(URL,"Large","toolbar=no,width=420,height=400,status=no,scrollbars=no,resize=no,menubars=no");
}
function adauga_cos(URL) {
aWindow=window.open(URL,"Large","toolbar=no,width=300,height=250,status=no,scrollbars=no,resize=no,menubars=no");
}
function adauga_localitate(URL) {
aWindow=window.open(URL,"Large","toolbar=no,width=300,height=300,status=no,scrollbars=no,resize=no,menubars=no");
}
function adauga_cartier(URL) {
aWindow=window.open(URL,"Large","toolbar=no,width=300,height=300,status=no,scrollbars=no,resize=no,menubars=no");
}
function openpoze(URLUS){
window.open(URLUS,"Large","toolbar=no,width=260,height=230,status=no,scrollbars=no,resize=no,menubars=no");
}
function addfav()
{
	if (window.sidebar) { // Mozilla Firefox Bookmark
		window.sidebar.addPanel("Tzoale.ro, portal haine", "http://www.tzoale.ro","");
	} else if( window.external ) { // IE Favorite
		window.external.AddFavorite( "http://www.tzoale.ro", "Tzoale.ro, portal haine"); }
}




//fctii noi

/*
* functii js
*/

function confirmSubmit (msg) {
	var agree=confirm(msg);
	if (agree) {
		return true ;
	} else {
		return false ;
	}
}

function is_empty (str) {
    return str.search("^[ \t\n\r]*$")>-1 ? true : false;
}

function is_int (str) {
    return str.search("^[0-9]*$")>-1 ? true : false;
}

function validField (str, msg) {
    if ( is_empty(str) ) {
		alert (msg);
		return false;
    }
    return true;
}

function multipleSelect ( arr, f, field ) {

    eval ('var val = document.forms.'+f+'.'+field+'.length');
	for ( j=0 ; j < val ; j++ ) {
	    if ( arr == 'all' ) {
	    	eval ('document.forms.'+f+'.'+field+'[j].selected = true;');
	    } else {
	        eval ('document.forms.'+f+'.'+field+'[j].selected = false;');
	    }
	}
	if ( arr == 'all' ) {
	    return "";
	}

	var b = arr.split (',');
	for ( i=0 ; i < b.length ; i++ ) {
	    for ( j=0 ; j < val ; j++ ) {
	        if ( b[i] == eval ('document.forms.'+f+'.'+field+'[j].value') ) {
	    		eval ('document.forms.'+f+'.'+field+'[j].selected = true');
	        }
	    }
	}
}

function setValue (field, f, val) {
	eval ("document.forms."+f+"."+field+".value='"+val+"'");
}

function getValue (field, f) {
	eval ("var x = document.forms."+f+"."+field+".value");
	return x;
}

function doSubmit ( f ) {
	eval ('document.forms.'+f+'.submit ();');
}

function checkboxAll (field, f, act, s, e) {
	for ( i=s ; i < e ; i++ ) {
	    if ( act == 'c' ) {
	    	eval ('document.forms.'+f+'.'+field+'['+i+'].checked = true;');
	    } else if ( act == 'u' ) {
	    	eval ('document.forms.'+f+'.'+field+'['+i+'].checked = false;');
	    }
	}
}

function inputAll (field, f, val, s, e) {
	for ( i=s ; i < e ; i++ ) {
    	eval ('document.forms.'+f+'.'+field+'['+i+'].value = "'+val+'";');
	}
}

function checkBox (f, field, m) {

	var checkbox = 	eval ('document.forms.'+f+'.'+field);
	var len = checkbox.length;

	var j = 0;
	for ( i=0 ; i < len ; i++ ) {
	    if ( checkbox[i].checked == true ) {
			j++;
			if ( j > m ) {
			    checkbox[i].checked = false;
			    alert ("Nu puteti selecta mai mult de "+m+" optiuni");
			    return false;
			}
	    }
	}
}

function checkCookie () {

var acceptsCookies = false;
if(document.cookie == '') {
    document.cookie = 'acceptsCookies=yes';
    if(document.cookie.indexOf('acceptsCookies=yes') != -1) {
	acceptsCookies = true;
    }
    return acceptsCookies;
} else {
  acceptsCookies = true;
  return acceptsCookies;
}
}


function setCookie (name, value, hours, path, domain, secure) {
    if ( checkCookie () == true ) {
        name = 'b'+name;
	var not_NN2 = (navigator && navigator.appName
		       && (navigator.appName == 'Netscape')
		       && navigator.appVersion
		       && (parseInt(navigator.appVersion) == 2))?false:true;

	if(hours && not_NN2) {
	    if ( (typeof(hours) == 'string') && Date.parse(hours) ) {
		var numHours = hours;
	    } else if (typeof(hours) == 'number') {
		var numHours = (new Date((new Date()).getTime() + hours*3600000)).toGMTString();
	    }
	}
	document.cookie = name + '=' + escape(value) + ((numHours)?(';expires=' + numHours):'') + ((path)?';path=' + path:'') + ((domain)?';domain=' + domain:'') + ((secure && (secure == true))?'; secure':'');
    }
}


function getCookie(name) {
    if(document.cookie == '') {
		return false;
    } else {
		var firstChar, lastChar;
		var theBigCookie = document.cookie;
		firstChar = theBigCookie.indexOf(name);
		var NN2Hack = firstChar + name.length;
		if((firstChar != -1) && (theBigCookie.charAt(NN2Hack) == '=')) {
	    	firstChar += name.length + 1;
	    	lastChar = theBigCookie.indexOf(';', firstChar);
	    	if(lastChar == -1) lastChar = theBigCookie.length;
	    	return unescape(theBigCookie.substring(firstChar, lastChar));
		} else {
	    	return false;
		}
    }
}

function openWinPozaSH(URL) {
aWindow=window.open(URL,"Large","toolbar=no,width=420,height=400,status=no,scrollbars=yes,resizable=yes,menubars=no");
}

function print_doc (url)
{
	var pwin = window.open (url, "", "toolbar=yes, width=800, height=600,scrollbars=yes,resizable=yes");
}

function check_this_out()
{
	form = document.getElementById('form1');
	if(form.nume_firma.value == '')
	{
		alert('Va rugam introduceti numele');
		return false;
	}	
	else if(form.tel.value == '')
	{
		alert('Va rugam introduceti telefonul');
		return false;
	}
	
	else if(form.email.value == '')
	{
		alert('Va rugam introduceti emailul');
		return false;
	}
	else
		document.getElementById('form1').submit();	
	
}