function SearchString() // aici incepe functia de "search product" din vm-ul "luxury_top_link"
{
	document.getElementById('searchForm').action = "/searched_products.aspx";
	document.getElementById('searchForm').submit();
}   


function doSearchHitEnter(e)
{
	 var keynum;
	
	 if(window.event) // IE
	 {
	 keynum = e.keyCode;
	 }
	 else if(e.which) // Netscape/Firefox/Opera
	 {
	 keynum = e.which;
	 }
	 if (keynum == 13){
		SearchString();
	 return false;
	 }
	 return true;
} // se termina functia de "search product"


	var _client_type_var=0; // aici incepe functia de "cos cumparaturi" din vm-ul "luxury_cos_cumparaturi"
	var _plata_type_var=0;

	function itemUpdate(x, msg1)
{
	var id=document.getElementById('itemid_'+x).value;
	var q=document.getElementById('itemnr_'+x).value;

	if(q>0)
	{
	  document.getElementById('_cart_action').value="Update";
	  document.getElementById('_cart_item_id').value=id;
	  document.getElementById('_cart_item_nr').value=q;
	  document.getElementById('_cart_item_index').value=x;
		
	  document.getElementById('submit1').submit();

	}
	else
	{
		alert(msg1)
	}
}

function itemDelete(x){
	var id=document.getElementById('itemid_'+x).value;
	alert(x);
	alert(id);
	
	document.getElementById('_cart_action').value="Delete";
	document.getElementById('_cart_item_id').value=id;
	document.getElementById('_cart_item_index').value=x;
	document.getElementById('submit1').submit();
}

  function UpdateTotalSum()
{
  document.getElementById('_cart_action').value="Update";
  document.getElementById('submit1').submit();
}

   function DoCommand(msg1,msg2,msg3)
{
   var sw=0;	
   
	if((!verifyRadio("box1")) && (sw==0))
	{
		alert(msg1);
		sw=1;
	}
		
	if((!verifyRadio("box2")) && (sw==0))
	{
		alert(msg2);
		sw=1;
	}	
	if((!verifyRadio("box3")) && (sw==0))
	{
		alert(msg3);
		sw=1;
	}
	if(sw==0)
	{	
  		document.getElementById('_cart_action').value="Command";
  		document.getElementById('submit1').submit();
	}
}
  
	function submiteaza()
{
	document.getElementById('submit1').submit();
}

function  verifyRadio(checkid)
{
  	var checkedElements = document.getElementById(checkid).getElementsByTagName('input');
  	var ischecked=false;
  	for(i=0; i<checkedElements.length; i++)
	{
  		if((checkedElements[i].type=="radio") &&  checkedElements[i].checked)
  		ischecked=true;		
  	}
  	return ischecked;
  	
}
  
function verifyType(element)
{
	if (element.checked)
	{
		if(element.id == 'persoana fizica')
		{
			alert("Fizica");
		}
		if(element.id == 'persoana juridica')
		{
			alert("Juridica");
		}
	}
}  	
	
function limitText(id, limitNum) 
{
	limitField=document.getElementById(id);
	if (limitField.value.length > limitNum) 
	{
		limitField.value = limitField.value.substring(0, limitNum);
	} 
}     // se termina functia de "cos cumparaturi"	


function doLogin()    //aici incepe functia de logare utilizator din vm-ul "account acces" si "account acces2"
{
		
	  document.getElementById('actType').value="login";
	  
	  
  
}

function doLogout()
{	
	document.getElementById('actType').value="logout";
	
	
}

function isEmail(string)
{
if (string.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) != -1)
return true;
else
return false;
}
function doForgotPass(msg1)
{
	if(isEmail(document.getElementById('_email').value)){
	document.getElementById('_type').value="forgotPass";	
	document.getElementById('account_acces').submit();
} else
alert(msg1);
}


function doForgotPass1()
{	x=document.getElementById('forget-top');
	x.style.display='block';
	y=document.getElementById('loginbox-top');
	y.style.display='none';

}

function doChangeToLogin()
{	x=document.getElementById('forget-top');
	x.style.display='none';
	y=document.getElementById('loginbox-top');
	y.style.display='block';

}

function doForgotHitEnter(e)
 	{
 var keynum;

 if(window.event) // IE
 {
 keynum = e.keyCode;
 }
 else if(e.which) // Netscape/Firefox/Opera
 {
 keynum = e.which;
 }
 if (keynum == 13){
	doForgotPass();
 return false;
 }
 return true;
}

 //aici se termina functia pentru "logare utilizator"


  //aici incepe functia pentru "abonare la newsletter" din vm-ul "luxury_newsletter"


function newsletter(msg2,msg1)
{ 	
		
		var sw=0;

		if (document.getElementById('subscription_email').value.length == 0)
		{
			alert(msg2);
			document.getElementById('subscription_email').focus();
			sw=1;
		} 
		if ((document.getElementById('subscription_email').value == 'adresa de e-mail')&&(sw==0))
		{
			alert(msg1);
			document.getElementById('subscription_email').focus();
			sw=1;
		} 		 
		if ((isEmail(document.getElementById('subscription_email').value) == false)&&(sw==0))
		{
			alert(msg2);
			document.getElementById('subscription_email').focus();
			sw=1;
		}
	if (sw==0)
	{	
		document.getElementById('newsletter').submit();
	}
}   //aici se termina functia de "abonare la newsletter"


function doOrderHitEnter(e) //aici incepe functia pentru "order status" din vm-ul "luxury_order_status"
{
	var keynum;

	if(window.event) // IE
	{
	keynum = e.keyCode;
	}
	else if(e.which) // Netscape/Firefox/Opera
	{
	keynum = e.which;
	}
	if (keynum == 13)
	{
	orderstatus();
	return false;
	}
	return true;
}

function isNumber(string)
{
	var reg=/^[0-9]+$/
	if(string.search(reg)!=-1)
	return true;
	else
	return false;
}

function orderstatus (msg1,msg2)
{
	var sw=0;

		if (document.getElementById('orderstat').value.length == 0)
		{
		alert(msg1);
		document.getElementById('orderstat').focus();
		sw=1;
		} 
		if ((document.getElementById('orderstat').value == 'numarul comenzii')&&(sw==0))
		{
		alert(msg1);
		document.getElementById('orderstat').focus();
		sw=1;
		} 	
		if ((isNumber(document.getElementById('orderstat').value) == false)&&(sw==0))
		{
		alert(msg2);
		sw=1;
		}
	if (sw==0)		
	{
	window.location.href='/order_details.aspx?OrderId='+document.getElementById('orderstat').value;
	}
}   //aici se termina functia pentru "order status"


   // aici incepe functia pentru formularul de contact din vm-ul "luxury_formular"


function contact_formular1(msg1,msg2,msg3) 
{ 
	var sw=0;
	
	
	if ((document.getElementById('_name_form').value.length == 0))
	{
		alert(msg1);
		document.getElementById('_name_form').focus();
		sw=1;
	}
	if ((document.getElementById('_name_form').value == 'nume')&&(sw==0))
	{
		alert(msg1);
		document.getElementById('_name_form').focus();
		sw=1;
	}
		if (isEmail(document.getElementById('_email_form').value) == false&& (sw==0)) {
		alert(msg2);
		document.getElementById('_email_form').focus();
		sw=1;
	}
	if ((document.getElementById('_message_form').value.length == 0)&&(sw==0)) {
		alert(msg3);
		sw=1;
	}
	if ((document.getElementById('_message_form').value == 'mesaj')&&(sw==0))
	{
		alert(msg3);
		document.getElementById('_message_form').focus();
		sw=1;
	}
		
	if (sw==0) {
		
		document.getElementById('form_contact').submit();
		
	}
}   //aici se termina functia pentru formular



function EditUser(msg1,msg2,msg3,msg4,msg5)    //aici incepe functia pentru "editarea de adresa" din vm-ul "luxury_delivery_addresses_edit"
{

		var sw=0;
		
    if ((document.getElementById('_addressname').value.length == 0)&&(sw==0))
		{
			alert(msg1);
			document.getElementById('_addressname').focus();
			sw=1;
		}  
		if ((document.getElementById('_address').value.length == 0)&&(sw==0))
		{
			alert(msg2);
			document.getElementById('_address').focus();
			sw=1;
		}
	
		if ((document.getElementById('_town').value.length == 0)&&(sw==0))
		{
			alert(msg3);
			document.getElementById('_town').focus();
			sw=1;
		}
		if ((document.getElementById('_region').value.length == 0)&&(sw==0))
		{
			alert(msg4);
			document.getElementById('_region').focus();
			sw=1;
		}
		if ((document.getElementById('_country').value.length == 0)&&(sw==0))
		{
			alert(msg5);
			document.getElementById('_country').focus();
			sw=1;
		}
		if (sw==0)
		{
			document.getElementById('_action').value="Edit";
			document.getElementById('deliv_address').submit();
				
		}
  }
  function DeleteUser(id)
  
  {
 		document.getElementById('_action').value="Delete";
		document.getElementById('deliv_address').submit();
	
  }        //aici se termina functia pentru "editarea de adresa"
  
  
  function writeDay(){          //aici se incepe functia pentru "crearea de cont" din vm-ul "luxury_creare_cont"
	for (var i=1;i<=31;i++) {
		document.write('<option value="'+i+'">'+i+'</option>')
	}
}

function writeYear(){
	for (var y=1940;y<=2000;y++) {
		document.write('<option value="'+y+'">'+y+'</option>')
	}
}


function validate_required(field,alerttxt) {
	field.value = (field.value).replace(/^\s*|\s*$/g,'');
	with (field) {
		if (value==null||value=="") {
			alert(alerttxt);
			return false;
		}
		else {
			return true;
		}
	}
}

function validate_email(field,alerttxt) {
	with (field) {
		var emailRegEx = /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i;
	    if (document.accountForm._account_email.value.search(emailRegEx) == -1) {
			alert(alerttxt);
			return false;
	    }
		else {
			return true;
		}
	}
}

function validate_passwd(field,alerttxt,alerttxt2) {
	with (field) {
		if (document.accountForm._account_password.value.length < 6 ) {
			alert(alerttxt);
			return false;
	    }
		else if (document.accountForm._account_password.value !== document.accountForm._account_password2.value ){
			alert(alerttxt2);
			return false;
		}
		else {
			return true;
		}
	}
}

function validate_check(field,alerttxt,alerttxt2) {
	with (field) {
		if (document.accountForm._approve.checked == false) {
			alert(alerttxt);
			return false;
		}
		else if (document.accountForm._over_18.checked == false){
			alert(alerttxt2);
			return false;
		}
		else {
			return true;
		}
	}
}

function validate_form_create(thisform,msg1,msg2,msg3,msg4,msg5,msg6,msg7,msg8,msg9,msg10,msg11,msg12,msg13,msg14,msg15,msg16,msg17,msg18,msg19,msg20,msg21,msg22) 
{
	with (thisform) {
		if (validate_required(_account_username,msg1)==false) {
			_account_username.focus();
			return false;
		}
		if (validate_required(_account_password,msg2)==false) {
			_account_password.focus();
			return false;
		}
		if (validate_required(_account_password2,msg3)==false) {
			_account_password2.focus();
			return false;
		}
		if (validate_passwd(_account_password,msg4,msg5)==false) {
			_account_password.focus();
			return false;
		}
		if (validate_required(_account_firstname,msg6)==false) {
			_account_firstname.focus();
			return false;
		}
		if (validate_required(_account_lastname,msg7)==false) {
			_account_lastname.focus();
			return false;
		}
		if (validate_required(_account_email,msg8)==false) {
			_account_email.focus();
			return false;
		}
		if (validate_email(_account_email,msg9)==false) {
			_account_email.focus();
			return false;
		}
		if (validate_required(_account_day,msg10)==false) {
			_account_day.focus();
			return false;
		}
		if (validate_required(_account_month,msg11)==false) {
			_account_month.focus();
			return false;
		}
		if (validate_required(_account_year,msg12)==false) {
			_account_year.focus();
			return false;
		}
		if (validate_check(_approve,msg13,msg14)==false) {
			_approve.focus();
			return false;
		}
		if (validate_required(_account_address1,msg15)==false) {
			_account_address1.focus();
			return false;
		}
		if (validate_required(_account_town,msg16)==false) {
			_account_town.focus();
			return false;
		}	
		if (validate_required(_account_region,msg17)==false) {
			_account_region.focus();
			return false;
		}
		if (validate_required(_account_country,msg18)==false) {
			_account_country.focus();
			return false;
		}		
		if (validate_required(_account_zip,msg19)==false) {
			_account_zip.focus();
			return false;
		}
		if (validate_required(_account_cnp,msg20)==false) {
			_account_cnp.focus();
			return false;
		}
		if (validate_required(_account_identity_card_number,msg21)==false) {
			_account_identity_card_number.focus();
			return false;
		}	
		if (validate_required(_account_telephone,msg22)==false) {
			_account_telephone.focus();
			return false;
		}
				
		if(!verify('check'))
		
		{
			alert('Campurile marcate cu \' * \' sunt obligatorii!');
			return false;
		}
	}
}

function validate_form(thisform,msg1,msg6,msg7,msg8,msg9,msg10,msg11,msg12,msg13,msg14,msg15,msg16,msg17,msg18,msg19,msg20,msg21,msg22) 
{
	with (thisform) {
		if (validate_required(_account_username,msg1)==false) {
			_account_username.focus();
			return false;
		}
		if (validate_required(_account_firstname,msg6)==false) {
			_account_firstname.focus();
			return false;
		}
		if (validate_required(_account_lastname,msg7)==false) {
			_account_lastname.focus();
			return false;
		}
		if (validate_required(_account_email,msg8)==false) {
			_account_email.focus();
			return false;
		}
		if (validate_email(_account_email,msg9)==false) {
			_account_email.focus();
			return false;
		}
		if (validate_required(_account_day,msg10)==false) {
			_account_day.focus();
			return false;
		}
		if (validate_required(_account_month,msg11)==false) {
			_account_month.focus();
			return false;
		}
		if (validate_required(_account_year,msg12)==false) {
			_account_year.focus();
			return false;
		}
		if (validate_check(_approve,msg13,msg14)==false) {
			_approve.focus();
			return false;
		}
		if (validate_required(_account_address1,msg15)==false) {
			_account_address1.focus();
			return false;
		}
		if (validate_required(_account_town,msg16)==false) {
			_account_town.focus();
			return false;
		}	
		if (validate_required(_account_region,msg17)==false) {
			_account_region.focus();
			return false;
		}
		if (validate_required(_account_country,msg18)==false) {
			_account_country.focus();
			return false;
		}		
		if (validate_required(_account_zip,msg19)==false) {
			_account_zip.focus();
			return false;
		}
		if (validate_required(_account_cnp,msg20)==false) {
			_account_cnp.focus();
			return false;
		}
		if (validate_required(_account_identity_card_number,msg21)==false) {
			_account_identity_card_number.focus();
			return false;
		}	
		if (validate_required(_account_telephone,msg22)==false) {
			_account_telephone.focus();
			return false;
		}
				
		if(!verify('check'))
		
		{
			alert('Campurile marcate cu \' * \' sunt obligatorii!');
			return false;
		}
	}
}

function verify(checkid)
	{

	
		var send = true;
		var mesaj = '';
		var focus;
		var checkedElements = $('*', document.getElementById(checkid));

			for(i=0; i<checkedElements.length; i++)
			{
			
				if (checkedElements[i].tagName.toLowerCase() == 'input') 
				{ 
					if(checkedElements[i].getAttribute('rel'))
					{					
						if (checkedElements[i].getAttribute('rel').toLowerCase().indexOf("notblank") != -1)
						{	if(checkedElements[i].value == '')
							{	
								checkedElements[i].className="borderRosu";
								if(send) focus = checkedElements[i];
								send = false;
							}
						}
					}
				}
			}
		
		
		return send;
	}

function checkAge(msg1)
{
	
	var now = new Date();

	var day=document.getElementById('_account_day').value;
	var month=document.getElementById('_account_month').value;
	var year=document.getElementById('_account_year').value;
	var birthdate=month+'/'+day+'/'+year;
	var birthdate2=month+'/'+day+'/'+year;
	
	document.getElementById('_account_birth_date_div').innerHTML = '<input type="hidden" name="_account_birth_date" id="_account_birth_date" value='+birthdate+' />';
	
	var date_comp = birthdate.split('/');
	var birthday = new Date(date_comp[2],date_comp[1],date_comp[0]);
	
	if(Math.floor((now.getTime()-birthday.getTime())/(365*24*3600*1000)) < 18)
	{
	alert(msg1);
	document.getElementById('over_18').checked=false;
	return false;
	}
}

 function showPage(id)
        {
            var totalNumberOfPages = 1;
            
            for(i=1; i<=totalNumberOfPages; i++)
            {
                if(document.getElementById('page' + i))
                    document.getElementById('page' + i).style.display = 'none';
            }
            
            if(document.getElementById('page' + id))
                document.getElementById('page' + id).style.display = 'block';
        }


		
		function doHitEnter(e)
 	{
		var keynum;

		if(window.event) // IE
		{
			keynum = e.keyCode;
		}
		
	else 
	
		if(e.which) // Netscape/Firefox/Opera
		{
			keynum = e.which;
		}
	 
		if (keynum == 13)
		{
			validate_form(thisform);
			return false;
		}
			return true;
	}    

function changeToOn(){
	if(document.getElementById('account_newsletter').value == 0) {
		document.getElementById('account_newsletter').value="On";
	} else {
		document.getElementById('account_newsletter').value = 0;
	}
}


	// aici se termina functia pentru "crearea de cont"
	
	
 //aici incepe functia pentru "editare de cont" din vm-ul"luxury_editare_cont"

function writeDay1(birthDateE){
	var bDate = new Array();
	bDate = birthDateE.split(".");
	var day1 = bDate[0];
	
	for (var i=1;i<=31;i++) {
		document.write('<option '+ (day1==i ? (' selected="selected" value="'+i+'" ') : ('value="'+ i +'"') ) +'>'+i+'</option>');
	}
}

function writeMonth1(birthDateE){
	var months = new Array("Luna", "Ianuarie", "Februarie", "Martie", "Aprilie", "Mai", "Iunie", "Iulie", "August", "Septembrie", "Octombrie", "Noiembrie", "Decembrie");
	var bDate = new Array();
	bDate = birthDateE.split(".");
	var month1 = bDate[1];
	for (var m=1;m<=12;m++) {
		document.write('<option '+ (month1==m ? ' selected="selected" value="'+m+'" ' : 'value="'+m+'"') +'>'+months[m]+'</option>');
	}
}		

function writeYear1(birthDateE){
	var bDate = new Array();
	bDate = birthDateE.split(".");
	var year1 = bDate[2];
	for (var y=1940;y<=2000;y++) {
		document.write('<option '+ (year1.substr(0,4)==y ? ' selected="selected" value="'+y+'" ' : 'value="'+y+'"') +'>'+y+'</option>');
	}
}
//create account functions
function writeDay2(birthDateE){
	var bDate = new Array();
	bDate = birthDateE.split("/");
	var day1 = bDate[1];
	
	for (var i=1;i<=31;i++) {
		document.write('<option '+ (day1==i ? (' selected="selected" value="'+i+'" ') : ('value="'+ i +'"') ) +'>'+i+'</option>');
	}
}

function writeMonth2(birthDateE){
	var months = new Array("Luna", "Ianuarie", "Februarie", "Martie", "Aprilie", "Mai", "Iunie", "Iulie", "August", "Septembrie", "Octombrie", "Noiembrie", "Decembrie");
	var bDate = new Array();
	bDate = birthDateE.split("/");
	var month1 = bDate[0];
	for (var m=1;m<=12;m++) {
		document.write('<option '+ (month1==m ? ' selected="selected" value="'+m+'" ' : 'value="'+m+'"') +'>'+months[m]+'</option>');
	}
}	

function writeYear2(birthDateE){
	var bDate = new Array();
	bDate = birthDateE.split("/");
	year1 = bDate[2];
	for (var y=1940;y<=2000;y++) {
		document.write('<option '+ (year1==y ? ' selected="selected" value="'+y+'" ' : 'value="'+y+'"') +'>'+y+'</option>');
	}
}


//aici se termina functia pentru "editare de cont"	
	
	//aici incepe functia pentru "order_message" din vm-ul "luxury_order_message"
function Submite()  
	{
		document.getElementById('order_mess').submit();
	}
// aici se termina functia pentru "order message"

//aici incepe functia pentru "product comment" din vm-ul "luxury_product_comment"
	

function recomanda(msg1,msg2,msg3,msg4,msg5,msg6) { 
	var sw = 0;
	
	
	if ((document.getElementById('numeletau').value.length == 0) && (sw==0)) 
	{
		alert(msg1);
		document.getElementById('numeletau').focus();
		sw = 1;
	}
	if ((document.getElementById('numelelui').value.length == 0) && (sw==0)) 
	{
		alert(msg2);
		document.getElementById('numelelui').focus();
		sw = 1;
	}
	if ((document.getElementById('emailultau').value.length == 0)&&(sw==0))
	{
		alert(msg3);
		document.getElementById('emailultau').focus();
		sw = 1;
	}
	if ((isEmail(document.getElementById('emailultau').value) == false)&&(sw==0))
	{
		alert(msg4);
		document.getElementById('emailultau').focus();
		sw = 1;
	}
	if ((document.getElementById('emailullui').value.length == 0)&&(sw==0))
	{
		alert(msg5);
		document.getElementById('emailullui').focus();
		sw = 1;
	}
	if ((isEmail(document.getElementById('emailullui').value) == false)&&(sw==0))
	{
		alert(msg6);
		document.getElementById('emailullui').focus();
		sw = 1;
	}
	
	if (sw == 0) {
    
	document.getElementById('send_friend').submit();
	window.location.href='http://z.ekontent.ro/DoEmail.aspx?redirect=http://buyosshop.devel.ekontent.ro/send_product.aspx&from='+document.getElementById('emailultau').value+'&to='+document.getElementById('emailullui').value+'&subiect='+document.getElementById('numelelui').value+' , I highly recommend you Buyos! &mesaj='+document.getElementById('numelelui').value+',<br /> I highly recommend you Buyos! <br />'+document.getElementById('numeletau').value+'<br /> <br />';
		
	
	}
}

function doComment(msg1,msg2,msg3,msg4)

     {
		var sw=0;
		
		
		if (((document.getElementById('name').value.length == 0) || (document.getElementById('name').value=='Nume'))&&(sw==0))
		{
			alert(msg1);
			document.getElementById('name').focus();
			sw=1;
		} 

		if (document.getElementById('subscription_email3').value.length == 0)
		{
			alert('sss');
			document.getElementById('subscription_email3').focus();
			sw=1;
		} 
		if ((document.getElementById('subscription_email3').value == 'e-mail')&&(sw==0))
		{
			alert(msg2);
			document.getElementById('subscription_email3').focus();
			sw=1;
		} 		 
		if ((isEmail(document.getElementById('subscription_email3').value) == false)&&(sw==0))
		{
			alert(msg3);
			document.getElementById('subscription_email3').focus();
			sw=1;
		}
		
		
		if (((document.getElementById('comentariu').value.length == 0) || (document.getElementById('comentariu').value=='Comentariu'))&&(sw==0))
		{
			alert(msg4);
			document.getElementById('comentariu').focus();
			sw=1;
		}
	
		if (sw==0)
	     {	 document.getElementById('cactType').value="comment";

		     document.getElementById('productcomment').submit();	    
	     }
}
function coment3()
{document.getElementById('comm2').style.display='block';
document.getElementById('comm4').style.display='none';
}


function showPage1(id1,id2)
        { 
			if( document.getElementById(id1).style.display == 'block')
				document.getElementById(id1).style.display = 'none';
			else
				document.getElementById(id1).style.display = 'block';
			document.getElementById(id2).style.display = 'none';
	
        }
// aici se termina functia pentru "product comment"


//aici incepe functia pentru "product details" din vm-ul "luxury_product_details"
function isInteger (s)
   {
      var i;

      if (isEmpty(s))
      if (isInteger.arguments.length == 1) return 0;
      else return (isInteger.arguments[1] == true);

      for (i = 0; i < s.length; i++)
      {
         var c = s.charAt(i);
		if (!isDigit(c) || (i==0 && c=="0")) return false;
        
      }

      return true;
   }

   function isEmpty(s)
   {
      return ((s == null) || (s.length == 0))
   }

   function isDigit (c)
   {
      return ((c >= "0") && (c <= "9"))
   }

function validateInt1(productId,msg1)
   {	
      var o = document.getElementById('_cart_nr');
	
      switch (isInteger(o.value))
      {
         case true:
			if(productId == '0')
			{
				document.getElementById('add_cart').action="/cos_cumparaturi.aspx";
				document.getElementById('_cart_action').value='Add';
				document.getElementById('add_cart').submit();
			}
			else
				if(productId > '0')
				{
					document.getElementById('add_cart').action="/wish_list.aspx?_pid="+productId+"&amp;_cart_nr="+o.value;
	document.getElementById('add_cart').submit();
	}
            break;
         case false:

            document.getElementById('add_cart').action="/recommended_products.aspx";
             alert(msg1);
      }
   }
//aici se termina functia pentru "product details"


//aici incepe functia pentru "produse dorite" din vm-ul "luxury_wish_list"
function validateInt()
   {
		boxes = document.getElementById('validate').ordered.length;
		txt = "";	  

		if(boxes)
		{
			for (var i = 0; i < boxes; i++) 
			{
				if(document.getElementById('validate').ordered[i].checked)
				{
					if(i == boxes-1)
						txt = txt + document.getElementById('validate').ordered[i].value;
					else
						txt = txt + document.getElementById('validate').ordered[i].value + ", ";
				}									   
			}	
		}
		else
			txt = document.getElementById('validate').ordered.value;

		var strpidq = document.getElementById('_string_pid_q');						   
		strpidq.value = txt;								   
									   
		document.getElementById('validate').action="/cos_cumparaturi.aspx";
		document.getElementById('validate').submit();						   

	}
	
	
	
 function DoCommand1(msg1)
  {
   var sw=0;	
  
	if((!verifyCheckbox("box")) && (sw==0)){
		alert(msg1);
		sw=1;
		}
		
	if(sw==0)
	{	
  		validateInt();
	}
  }	
  
  function  verifyCheckbox(checkid){
  	var checkedElements = document.getElementById(checkid).getElementsByTagName('input');
  	var ischecked=false;
	
  	for(i=0; i<checkedElements.length; i++){
  		if((checkedElements[i].type=="checkbox") &&  checkedElements[i].checked)
  		ischecked=true;		
  	}
  	return ischecked;
  	
  	} 
	
	
	 function  check(checkid){
	var checkedElements = document.getElementById(checkid).getElementsByTagName('input');
  
	for(i=0; i<checkedElements.length; i++){
	  		 checkedElements[i].checked=true;
	  		
	  	}
  
  	}  
	function  uncheck(checkid){
	var checkedElements = document.getElementById(checkid).getElementsByTagName('input');
  	
	for(i=0; i<checkedElements.length; i++){
	  		 checkedElements[i].checked=false;
	  		
	  	}
  
  	} 	
//aici se termina functia pentru "produse dorite"	

$(document).ready(function() {
	
	$('#tabs_b a').click(function () {
	$('#tabs_b a').removeAttr('class');
	$(this).attr('class','on');
	var a_id = $(this).attr('id');
	var sel_div = '#tab_'+a_id;
	$('#tabs_gallery .cls_dv').attr('style','display: none;');
	$(sel_div).attr('style','display: block; position: relative;');
	});
		
	$('#tabs_b a').click(function () {
	$('#tabs_b a').removeAttr('class');
	$(this).attr('class','on');
	var a_id = $(this).attr('id');
	var sel_div = '#tab_'+a_id;
	$('#tabs_gallery .cls_dv').attr('style','display: none;');
	$(sel_div).attr('style','display: block; position: relative;');
		});

});
