var win=null;
function NewWindow_20090227(mypage,myname,w,h,scroll,pos){
if(pos=='random'){LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
if(pos=='center'){LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;}
else if((pos!='center' && pos!='random') || pos==null){LeftPosition=0;TopPosition=20}
settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=yes';
win=window.open(mypage,myname,settings);}

function NewWindow(mypage, myname, w, h, scroll, pos) {
	var test_scroll=scroll;
	if(pos=='random'){LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
	if(pos=='center')
	{
	    if (screen.width && screen.height)
	    {
	        //alert(w+" "+h+" "+screen.width+" "+screen.height);
	        if (screen.width<w) {LeftPosition=20;w=screen.width-50;test_scroll='yes'}
	        else {LeftPosition=(screen.width-w)/2;}
	        if ((screen.height-50)<=h) {TopPosition=20;h=screen.height-170;test_scroll='yes'}
	        else {TopPosition=(screen.height-h)/2;}
	    }
	    else {LeftPosition=20;TopPosition=20;test_scroll='yes'}
	    //alert(LeftPosition+" "+TopPosition+" "+w+" "+h+" "+screen.width+" "+screen.height);
	}
	else if((pos!='center' && pos!='random') || pos==null){LeftPosition=20;TopPosition=20}
    settings='width='+w+',height='+h+',top='+(TopPosition-50)+',left='+LeftPosition+',scrollbars='+test_scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=yes';
	win=window.open(mypage,myname,settings);
	
	return win;
}


function checkAll(field)
{
if (!eval(field[0].checked)) {
  for(i = 0; i < field.elements.length; i++)
     field[i].checked = true ;
}
else

{
 for(i = 0; i < field.elements.length; i++)
    field[i].checked = false ;
}
}


function SwitchMenu(obj){
        if(document.getElementById){
        var el = document.getElementById(obj);
        var ar = document.getElementById("masterdiv").getElementsByTagName("span"); //DynamicDrive.com change
                if(el.style.display != "block"){ //DynamicDrive.com change
                        for (var i=0; i<ar.length; i++){
                                if (ar[i].className=="submenu") //DynamicDrive.com change
                                ar[i].style.display = "none";
                        }
                        el.style.display = "block";
                }
                else{
                        el.style.display = "none";
                }
        }
}

function checkAction(val)
{
	if(val==3)
	{
		document.store.what.value = 'cos';
		//document.store.submit();
	}
	if(val==1)
	{
		alert("ATENTIE: Aceasta optiune functioneaza doar cand sunteti logat");
		document.location = '#';
	}
	if(val==4)
	{
		alert("ATENTIE: Acest produs nu exista momentan in stoc. \n\n Utilizati meniul Asistenta tehnica pentru a afla mai multe detalii \n\n Va multumim pentru intelegere");
	}	
	if(val==2)
	{
		document.store.what.value = 'salveaza';
		document.store.submit();
	}
}

function checkShop(val)
{
	if(val==1)
	{
		document.store.what.value = 'addcart';
		document.store.submit();
	}
	if(val==2)
	{
		document.store.what.value = 'goleste';
		document.store.submit();
	}
	if(val==3)
	{
		document.store.what.value = 'confirma';
		document.store.submit();
	}
	if(val==4)
	{
		document.store.what.value = 'info';
		document.store.submit();
	}
	if(val==5)
	{
		document.store.what.value = 'renunta';
		document.store.submit();
	}
	if(val==7)
	{
		document.store.what.value = 'confirm_logged';
		document.store.submit();
	}
}


function menushow(idnum)
{
	if(document.getElementById){
        	if(document.getElementById("menu"+idnum)){
		var elem = document.getElementById("menu"+idnum);
			if(elem == null) { return; }
			if(elem.style.display == "none") { elem.style.display = ""; }
			else { elem.style.display = ""; }
		}
		//window.event.cancelBubble = true;
		//return false;
	}
}
function menuhide(idnum)
{
	if(document.getElementById){
        	if(document.getElementById("menu"+idnum)){
		var elem = document.getElementById("menu"+idnum);
			if(elem == null) { return; }
			if(elem.style.display == "none") { elem.style.display = "none"; }
			else { elem.style.display = "none"; }
		}
		//window.event.cancelBubble = true;
		//return false;
	}
}


function show_adresa() 
{
	
	if (document.form_pers.adrl.checked) 
	{
		document.form_pers.adresa_livrare.disabled           	= true;
		document.form_pers.adresa_livrare.style.backgroundColor = '#eeeeee';
		document.getElementById("adrliv").style.display         = 'none';

	} 
	else 
	{
		document.form_pers.adresa_livrare.disabled              = false;
		document.form_pers.adresa_livrare.style.backgroundColor = '#ffffff';
		document.getElementById("adrliv").style.display         = 'block';
	}
}

function show_statut()
{
	var selObj = document.getElementById('statut');
	var selIndex = selObj.selectedIndex;
	//alert(selObj.options[selIndex].value);
	if (selObj.options[selIndex].value == 'juridica') 
	{
		document.form_pers.cnp.disabled 			= true;
		document.form_pers.denf.disabled 			= false;
		document.form_pers.codf.disabled 			= false;
		document.form_pers.nume_banca.disabled 		= false;
		document.form_pers.iban.disabled			= false;
		document.getElementById("pf").style.display = 'none';
		document.getElementById("pj").style.display = 'block';
	}
	else
	{
		document.form_pers.cnp.disabled 			= false;
		document.form_pers.denf.disabled 			= true;
		document.form_pers.codf.disabled 			= true;
		document.form_pers.nume_banca.disabled 		= true;
		document.form_pers.iban.disabled 			= true;
		document.getElementById("pj").style.display = 'none';
		document.getElementById("pf").style.display = 'block';		
	}
}

if (parseInt(navigator.appVersion.substring(0,1))>=3) 
{
	buton7_on = new Image();   buton7_off = new Image();
	buton8_on = new Image();   buton8_off = new Image();
	
	buton7_on.src  = '/img/but/b77.gif';
	buton7_off.src = '/img/but/b7.gif';
	buton8_on.src  = '/img/but/b88.gif';
	buton8_off.src = '/img/but/b8.gif';
}

function activate(image) {
  if (parseInt(navigator.appVersion.substring(0,1))>=3) {
      imagesrc = eval(image + "_on.src");
      document[image].src = imagesrc;
  }
}

function deactivate(image) {
  if (parseInt(navigator.appVersion.substring(0,1))>=3) { 
      imagesrc = eval(image + "_off.src");
      document[image].src = imagesrc;
  }
}