var win=null; 
function NewWindow(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=no'; win=window.open(mypage,myname,settings); 
} 

function sterg_item(ID1,ID2) {
	if(confirm("Sunteti sigur?"))
        document.location=ID2+"?sterg_id="+ID1
        }

function sterg_item2(ID1,ID2) {
	if(confirm("Sunteti sigur?"))
        document.location=ID2+"?restaurez_id="+ID1
        }

function NewWindow(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); 
}  
/// functii pentru imaginea de prezentrare a produsului




function returnimgcode(theimg,size1,size2){

var imghtml=""
if (theimg[1]!="")
imghtml='<a href="'+theimg[1]+'" onClick="NewWindow(this.href,\'per1\','+size1+','+size2+',\'no\',\'center\');return false"   >'
imghtml+='<img src="'+theimg[0]+'" border="'+imgborderwidth+'" width="'+imgwidth+'" />'
if (theimg[1]!="")
imghtml+='</a>'
return imghtml
}

function modifyimage(loadarea, imgindex,size11,size22){
	
if (document.getElementById){
var imgobj=document.getElementById(loadarea)
if (imgobj.filters && window.createPopup){
imgobj.style.filter=filterstring
imgobj.filters[0].Apply()
}
imgobj.innerHTML=returnimgcode(dynimages[imgindex],size11,size22)
if (imgobj.filters && window.createPopup)
imgobj.filters[0].Play()
return false
}
}

//target="'+optlinktarget+'"
/// functii pentru imaginea de prezentrare a produsului



// meniul din partea stanga a site-ului


/***********************************************
* Switch Menu script- by Martial B of http://getElementById.com/
* Modified by Dynamic Drive for format & NS4/IE4 compatibility
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

var persistmenu="yes" //"yes" or "no". Make sure each SPAN content contains an incrementing ID starting at 1 (id="sub1", id="sub2", etc)
var persisttype="sitewide" //enter "sitewide" for menu to persist across site, "local" for this page only

if (document.getElementById){ //DynamicDrive.com change
document.write('<style type="text/css">\n')
document.write('.submenu{display: none;}\n')
document.write('.subsubmenu{display: none;}\n')
document.write('</style>\n')
}

/* Menu */
function SwitchMenu(obj){
	if(document.getElementById){
	var el = document.getElementById(obj);
	var ar = document.getElementById("menu").getElementsByTagName("ul"); //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";
		}
	}
}

/* SubMenu */
function SwitchSubMenu(obj){
	if(document.getElementById){
	var el = document.getElementById(obj);
	var ar = document.getElementById("menu").getElementsByTagName("ul"); //DynamicDrive.com change
		if(el.style.display != "block"){ //DynamicDrive.com change
			for (var i=0; i<ar.length; i++){
				if (ar[i].className=="subsubmenu") //DynamicDrive.com change
				ar[i].style.display = "none";
			}
			el.style.display = "block";
		}else{
			el.style.display = "none";
		}
	}
}

/* COOKIES */
function get_cookie(Name) { 
var search = Name + "="
var returnvalue = "";
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search)
if (offset != -1) { 
offset += search.length
end = document.cookie.indexOf(";", offset);
if (end == -1) end = document.cookie.length;
returnvalue=unescape(document.cookie.substring(offset, end))
}
}
return returnvalue;
}

function onloadfunction(){
//	alert(get_cookie('sub'));
	if(get_cookie('sub')==''){
		SwitchMenu('sub1');
	}
	else if (persistmenu=="yes"){
		restoreMenuState("sub");
		restoreMenuState("subsub");		
	}
}

function restoreMenuState(level)
{
	var cookiename=(persisttype=="sitewide")? level : window.location.pathname
	var cookievalue=get_cookie(cookiename)
	if (cookievalue!="")
		document.getElementById(cookievalue).style.display="block"
}

function savemenustate(level){
	var inc=1, blockid=""
	while (document.getElementById(level+inc)){
		if (document.getElementById(level+inc).style.display=="block"){
		blockid=level+inc
		break
	}
		inc++
	}
	var cookiename=(persisttype=="sitewide")? level : window.location.pathname
	var cookievalue=(persisttype=="sitewide")? blockid+";path=/" : blockid
	document.cookie=cookiename+"="+cookievalue
}

function saveFullState()
{
	savemenustate("sub");
	savemenustate("subsub");
}

if (window.addEventListener)
	window.addEventListener("load", onloadfunction, false)
else if (window.attachEvent)
	window.attachEvent("onload", onloadfunction)
else if (document.getElementById)
	window.onload=onloadfunction

if (persistmenu=="yes" && document.getElementById)
	window.onunload=saveFullState

// meniul din partea stanga a site-ului


// pup-up la poze

// popu=up l;a poze



function arata_meniu(meniu){
document.getElementById(meniu).style.display="block";

}


function ascunde_meniu(meniu){
	
if(document.getElementById('mentine').value!=meniu)
	document.getElementById(meniu).style.display="none";
}


function dezmentine_meniu(meniu){
	if(document.getElementById('mentine').value==meniu)
			document.getElementById('mentine').value="";
	
}

function mentine_meniu(meniu){
		document.getElementById('mentine').value=meniu;
	
}

function check_close (meniu) {
	
		if(document.getElementById('mentine').value!=meniu)
			document.getElementById(meniu).style.display="none";
}