
/*open_page_kredit_kartica_bottom*/
function CartObrokOnChange( instType ) {
	
	if (instType!='cash')  {
		
				if (instType=='credit_card')  {
				document.getElementById('installment_number_card').disabled=false;
				showDiv_display('div_credit_card');
				hideDiv_display('div_trajnik');
				hideDiv_display('div_credit_normal');
				
				
					}
					else
					{
						document.getElementById('installment_number').disabled=false;	
						showDiv_display('div_trajnik');
						hideDiv_display('div_credit_card');				
						hideDiv_display('div_credit_normal');
			}
			}
	else
	{
			
				document.getElementById('installment_number').disabled=true;
					hideDiv_display('div_trajnik');
					hideDiv_display('div_credit_card');
					showDiv_display('div_credit_normal');
	}
}


function CartObrokOnChange_top( instType ) {
	
	if (instType!='cash')  {
		
				if (instType=='credit_card')  {
				document.getElementById('installment_number_card_top').disabled=false;
				showDiv_display('div_credit_card_top');
				hideDiv_display('div_trajnik_top');
				hideDiv_display('div_credit_normal_top');
				
				
					}
					else
					{
						document.getElementById('installment_number_top').disabled=false;	
						showDiv_display('div_trajnik_top');
						hideDiv_display('div_credit_card_top');				
						hideDiv_display('div_credit_normal_top');
			}
			}
	else
	{
			
				document.getElementById('installment_number_top').disabled=true;
					hideDiv_display('div_trajnik_top');
					hideDiv_display('div_credit_card_top');
					showDiv_display('div_credit_normal_top');
	}
}


function CartObrokOnChange_bottom( instType ) {
	
	if (instType!='cash')  {
		
				if (instType=='credit_card')  {
				document.getElementById('installment_number_card_bottom').disabled=false;
				showDiv_display('div_credit_card_bottom');
				hideDiv_display('div_trajnik_bottom');
				hideDiv_display('div_credit_normal_bottom');
				
				
					}
					else
					{
						document.getElementById('installment_number_bottom').disabled=false;	
						showDiv_display('div_trajnik_bottom');
						hideDiv_display('div_credit_card_bottom');				
						hideDiv_display('div_credit_normal_bottom');
			}
			}
	else
	{
			
				document.getElementById('installment_number_bottom').disabled=true;
					hideDiv_display('div_trajnik_bottom');
					hideDiv_display('div_credit_card_bottom');
					showDiv_display('div_credit_normal_bottom');
	}
}


///////-------------------------------------------------------------
                   //top
				   function change_price_quantity_top(q, pid, opid){

	var payment_type = '';
		var delivery_type = '';
		var post_nbr = '';
			 var string_cross= '';
			 var coupontext = "";
	
	if (document.getElementById('payment_type_top')!=null){
		payment_type = document.getElementById('payment_type_top').value;
	}	
		if (document.getElementById('delivery_type_top')!=null){
		delivery_type = document.getElementById('delivery_type_top').value;
	}
	
			if (document.getElementById('cart_add_cross_top')!=null){
				
				
				 var cross=document.getElementsByName("cart_add_cross_top");
				for(var i=0;i<cross.length;i++){
					
					if (cross[i].checked){
											string_cross = string_cross + cross[i].value + ',' ;
					}

						}
			}
	
	
	
			if (document.getElementById('post_top_nbr')!=null){
		post_nbr = document.getElementById('post_top_nbr').value;
	}
	
				if (document.getElementById('coupontext_top')!=null){
		coupontext = document.getElementById('coupontext_top').value;
	}

	if (opid == null)  {
		
		opid = 0;
	}
	

	
	  var jsCache = new Array();
    var AjaxObjects = new Array();

	    var url='ajax_price_calculation_minipages_v02_top.asp?q='+q+'&pid='+pid+'&opid='+opid+'&payment_type='+payment_type+'&coupontext='+coupontext+'&delivery_type='+delivery_type+'&post_nbr='+post_nbr+'&string_cross='+string_cross+'0';
			

        var ajaxIndex = AjaxObjects.length;
        AjaxObjects[ajaxIndex] = new sack();
        AjaxObjects[ajaxIndex].requestFile = url;
        AjaxObjects[ajaxIndex].onCompletion = function(){ 
				
				
				//price total
				value_price_total = parse_xml_element(AjaxObjects[ajaxIndex].response, 'price_total_top');	
	
				document.getElementById('price_total_td_top').innerHTML = value_price_total;

				if (parse_xml_element(AjaxObjects[ajaxIndex].response, 'postage_top') != null)
				{
									value_postage = parse_xml_element(AjaxObjects[ajaxIndex].response, 'postage_top');
									
									
									
									if (document.getElementById('postnina_td_top') != null){
									document.getElementById('postnina_td_top').innerHTML = value_postage; }
				}
				
				
				if (parse_xml_element(AjaxObjects[ajaxIndex].response, 'wdiscount_value_top') != null)
				{

									wdiscount_value = parse_xml_element(AjaxObjects[ajaxIndex].response, 'wdiscount_value_top');
									if (document.getElementById('wdiscount_value_td_top') != null){
									document.getElementById('wdiscount_value_td_top').innerHTML = wdiscount_value; }
				}
				
				
					if (parse_xml_element(AjaxObjects[ajaxIndex].response, 'choosen_place_top') != null)
				{

									choosen_place = parse_xml_element(AjaxObjects[ajaxIndex].response, 'choosen_place_top');
										if ((choosen_place == "xxx")||(choosen_place == '')) {
											/*document.getElementById('post_top_nbr').style.border='2px solid red';*/
											document.getElementById('post_top_nbr_check').value = 'xxx';
											}
										else
										{
											
										document.getElementById('post_top_nbr').className='';
										document.getElementById('post_top_nbr_check').value = '';}
										
				}
				
				
				if (parse_xml_element(AjaxObjects[ajaxIndex].response, 'installment_top') != null)
				{

									value_installment = parse_xml_element(AjaxObjects[ajaxIndex].response, 'installment_top');
									
									if (document.getElementById('installment_num_td_top') != null){
									document.getElementById('installment_num_td_top').innerHTML = value_installment; }
				}

	    };
        AjaxObjects[ajaxIndex].runAJAX();
    }
	
	
//---------------------------------- bottom -------------------------------------------

function change_price_quantity_bottom(q, pid, opid){

	var payment_type = '';
		var delivery_type = '';
		var post_nbr = '';
			 var string_cross= '';
			 var coupontext = "";
	
	if (document.getElementById('payment_type_bottom')!=null){
		payment_type = document.getElementById('payment_type_bottom').value;
	}	
		if (document.getElementById('delivery_type_bottom')!=null){
		delivery_type = document.getElementById('delivery_type_bottom').value;
	}
	
			if (document.getElementById('cart_add_cross_bottom')!=null){
				
				
				 var cross=document.getElementsByName("cart_add_cross_bottom");
				for(var i=0;i<cross.length;i++){
					
					if (cross[i].checked){
											string_cross = string_cross + cross[i].value + ',' ;
					}

						}
			}
	
	
	
			if (document.getElementById('post_bottom_nbr')!=''){
		post_nbr = document.getElementById('post_bottom_nbr').value;
	}
	
				if (document.getElementById('coupontext_bottom')!=null){
		coupontext = document.getElementById('coupontext_bottom').value;
	}

	if (opid == null)  {
		
		opid = 0;
	}
	

	
	  var jsCache = new Array();
    var AjaxObjects = new Array();

	    var url='ajax_price_calculation_minipages_v02_bottom.asp?q='+q+'&pid='+pid+'&opid='+opid+'&payment_type='+payment_type+'&coupontext='+coupontext+'&delivery_type='+delivery_type+'&post_nbr='+post_nbr+'&string_cross='+string_cross+'0';
			

        var ajaxIndex = AjaxObjects.length;
        AjaxObjects[ajaxIndex] = new sack();
        AjaxObjects[ajaxIndex].requestFile = url;
        AjaxObjects[ajaxIndex].onCompletion = function(){ 
				
				
				//price total
				value_price_total = parse_xml_element(AjaxObjects[ajaxIndex].response, 'price_total_bottom');	
	
				document.getElementById('price_total_td_bottom').innerHTML = value_price_total;

				if (parse_xml_element(AjaxObjects[ajaxIndex].response, 'postage_bottom') != null)
				{
									value_postage = parse_xml_element(AjaxObjects[ajaxIndex].response, 'postage_bottom');
									
									
									
									if (document.getElementById('postnina_td_bottom') != null){
									document.getElementById('postnina_td_bottom').innerHTML = value_postage; }
				}
				
				
				if (parse_xml_element(AjaxObjects[ajaxIndex].response, 'wdiscount_value_bottom') != null)
				{

									wdiscount_value = parse_xml_element(AjaxObjects[ajaxIndex].response, 'wdiscount_value_bottom');
									if (document.getElementById('wdiscount_value_td_bottom') != null){
									document.getElementById('wdiscount_value_td_bottom').innerHTML = wdiscount_value; }
				}
				
				
					if (parse_xml_element(AjaxObjects[ajaxIndex].response, 'choosen_place_bottom') != null)
				{

									choosen_place = parse_xml_element(AjaxObjects[ajaxIndex].response, 'choosen_place_bottom');
										if ((choosen_place == "xxx")||(choosen_place == '')) {
											/*document.getElementById('post_bottom_nbr').style.border='2px solid red';*/
											document.getElementById('post_bottom_nbr_check').value = 'xxx';
											}
										else
										{
											
										document.getElementById('post_bottom_nbr').className='';
										document.getElementById('post_bottom_nbr_check').value = '';}
										
				}
				
				
				if (parse_xml_element(AjaxObjects[ajaxIndex].response, 'installment_bottom') != null)
				{

									value_installment = parse_xml_element(AjaxObjects[ajaxIndex].response, 'installment_bottom');
									
									if (document.getElementById('installment_num_td_bottom') != null){
									document.getElementById('installment_num_td_bottom').innerHTML = value_installment; }
				}

	    };
        AjaxObjects[ajaxIndex].runAJAX();
    }
	
	//******************************************************************************
	

function change_price_quantity_xxx (q, pid, opid){
	

	var payment_type = '';
		var delivery_type = '';
		var post_nbr = '';
			 var string_cross= '';
			 var coupontext = "";
			 var installment_number = 1;
			 var testpl= '';
			 var post_nbr_ro='';
	
	if (document.getElementById('payment_type')!=null){
		payment_type = document.getElementById('payment_type').value;
	}
	
	if (document.getElementById('installment_number')!=null){
		installment_number = document.getElementById('installment_number').value;
	}
	
	
	
		if (document.getElementById('testpl')!=null){
		testpl = document.getElementById('testpl').value;
	}
	
	if (document.getElementById('delivery_type')!=null){
		delivery_type = document.getElementById('delivery_type').value;
	}
	
			if (document.getElementById('cart_add_cross')!=null){
				
				
				 var cross=document.getElementsByName("cart_add_cross");
				for(var i=0;i<cross.length;i++){
					
					if (cross[i].checked){
											string_cross = string_cross + cross[i].value + ',' ;
					}

						}
			}
	
	
	
			if (document.getElementById('post_nbr')!=null){
		post_nbr = document.getElementById('post_nbr').value;
	}
	
				if (document.getElementById('coupontext')!=null){
		coupontext = document.getElementById('coupontext').value;
	}

	if (opid == null)  {
		
		opid = 0;
	}
	
	  var jsCache = new Array();
    var AjaxObjects = new Array();

	    var url='ajax_price_calculation_minipages.asp?q='+q+'&pid='+pid+'&opid='+opid+'&payment_type='+payment_type+'&coupontext='+coupontext+'&delivery_type='+delivery_type+'&post_nbr='+post_nbr+'&string_cross='+string_cross+'0' + '&testpl=' + testpl + '&installment_number=' + installment_number ;

//alert(url);

        var ajaxIndex = AjaxObjects.length;
        AjaxObjects[ajaxIndex] = new sack();
        AjaxObjects[ajaxIndex].requestFile = url;
        AjaxObjects[ajaxIndex].onCompletion = function(){ 
				
				
				//price total
				value_price_total = parse_xml_element(AjaxObjects[ajaxIndex].response, 'price_total');	
				document.getElementById('price_total_td').innerHTML = value_price_total;




				if (parse_xml_element(AjaxObjects[ajaxIndex].response, 'postage') != null)
				{
									value_postage = parse_xml_element(AjaxObjects[ajaxIndex].response, 'postage');
									
									if (document.getElementById('postnina_td') != null){
				
			

				document.getElementById('postnina_td').innerHTML = value_postage; }
				}
				
				
				if (parse_xml_element(AjaxObjects[ajaxIndex].response, 'wdiscount_value') != null)
				{

									wdiscount_value = parse_xml_element(AjaxObjects[ajaxIndex].response, 'wdiscount_value');
									if (document.getElementById('wdiscount_value_td') != null){
									document.getElementById('wdiscount_value_td').innerHTML = wdiscount_value; }
				}
				
				
				
					if (parse_xml_element(AjaxObjects[ajaxIndex].response, 'post_nbr_ro') != null)
				{

									post_nbr_ro = parse_xml_element(AjaxObjects[ajaxIndex].response, 'post_nbr_ro');
									if (document.getElementById('post_nbr_ro_td') != null){
									document.getElementById('post_nbr_ro_td').innerHTML = post_nbr_ro; }
				}
				
					if (parse_xml_element(AjaxObjects[ajaxIndex].response, 'choosen_place') != null)
				{

									choosen_place = parse_xml_element(AjaxObjects[ajaxIndex].response, 'choosen_place');
										if (choosen_place == "xxx") {
											document.getElementById('post_nbr').style.border='2px solid red';
											
											}
										else
										{
											
										document.getElementById('post_nbr').className='';
										}
										
				}
				
				
			
			
			
			if (parse_xml_element(AjaxObjects[ajaxIndex].response, 'installment') != null)
				{

									value_installment = parse_xml_element(AjaxObjects[ajaxIndex].response, 'installment');
									
									
									
if (document.getElementById('installment_num_td') != null){
	
									document.getElementById('installment_num_td').innerHTML = value_installment; }
				}

	    };
        AjaxObjects[ajaxIndex].runAJAX();
    }
		
/*  -------------------------------------------------------------------------------------------  */


function change_price_quantity (q, pid, opid){
	

	var payment_type = '';
		var delivery_type = '';
		var post_nbr = '';
			 var string_cross= '';
			 var coupontext = "";
			 var installment_number = 1;
			 var testpl= '';
			 var post_nbr_ro='';
	
	if (document.getElementById('payment_type')!=null){
		payment_type = document.getElementById('payment_type').value;
	}
	
	if (document.getElementById('installment_number')!=null){
		installment_number = document.getElementById('installment_number').value;
	}
	
	
	
		if (document.getElementById('testpl')!=null){
		testpl = document.getElementById('testpl').value;
	}
	
	if (document.getElementById('delivery_type')!=null){
		delivery_type = document.getElementById('delivery_type').value;
	}
	
			if (document.getElementById('cart_add_cross')!=null){
				
				
				 var cross=document.getElementsByName("cart_add_cross");
				for(var i=0;i<cross.length;i++){
					
					if (cross[i].checked){
											string_cross = string_cross + cross[i].value + ',' ;
					}

						}
			}
	
	
	
			if (document.getElementById('post_nbr')!=null){
		post_nbr = document.getElementById('post_nbr').value;
	}
	
				if (document.getElementById('coupontext')!=null){
		coupontext = document.getElementById('coupontext').value;
	}

	if (opid == null)  {
		
		opid = 0;
	}
	
	  var jsCache = new Array();
    var AjaxObjects = new Array();

	    var url='ajax_price_calculation_minipages.asp?q='+q+'&pid='+pid+'&opid='+opid+'&payment_type='+payment_type+'&coupontext='+coupontext+'&delivery_type='+delivery_type+'&post_nbr='+post_nbr+'&string_cross='+string_cross+'0' + '&testpl=' + testpl + '&installment_number=' + installment_number ;

//alert(url);

        var ajaxIndex = AjaxObjects.length;
        AjaxObjects[ajaxIndex] = new sack();
        AjaxObjects[ajaxIndex].requestFile = url;
        AjaxObjects[ajaxIndex].onCompletion = function(){ 
				
				
				//price total
				value_price_total = parse_xml_element(AjaxObjects[ajaxIndex].response, 'price_total');	
				document.getElementById('price_total_td').innerHTML = value_price_total;




				if (parse_xml_element(AjaxObjects[ajaxIndex].response, 'postage') != null)
				{
									value_postage = parse_xml_element(AjaxObjects[ajaxIndex].response, 'postage');
									
									if (document.getElementById('postnina_td') != null){
				
			

				document.getElementById('postnina_td').innerHTML = value_postage; }
				}
				
				
				if (parse_xml_element(AjaxObjects[ajaxIndex].response, 'wdiscount_value') != null)
				{

									wdiscount_value = parse_xml_element(AjaxObjects[ajaxIndex].response, 'wdiscount_value');
									if (document.getElementById('wdiscount_value_td') != null){
									document.getElementById('wdiscount_value_td').innerHTML = wdiscount_value; }
				}
				
				
				
					if (parse_xml_element(AjaxObjects[ajaxIndex].response, 'post_nbr_ro') != null)
				{

									post_nbr_ro = parse_xml_element(AjaxObjects[ajaxIndex].response, 'post_nbr_ro');
									if (document.getElementById('post_nbr_ro_td') != null){
									document.getElementById('post_nbr_ro_td').innerHTML = post_nbr_ro; }
				}
				
					if (parse_xml_element(AjaxObjects[ajaxIndex].response, 'choosen_place') != null)
				{

									choosen_place = parse_xml_element(AjaxObjects[ajaxIndex].response, 'choosen_place');
										if (choosen_place == "xxx") {
											document.getElementById('post_nbr').className='inputboxerror';
											
											}
										else
										{
											
										//document.getElementById('post_nbr').className='';
										}
										
				}
				
				
			
			
			
			if (parse_xml_element(AjaxObjects[ajaxIndex].response, 'installment') != null)
				{

									value_installment = parse_xml_element(AjaxObjects[ajaxIndex].response, 'installment');
									
									
									
if (document.getElementById('installment_num_td') != null){
	
									document.getElementById('installment_num_td').innerHTML = value_installment; }
				}

	    };
        AjaxObjects[ajaxIndex].runAJAX();
    }
		
/*  -------------------------------------------------------------------------------------------  */

function parse_xml_element (xml, element){
try //Internet Explorer
  {
  xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
  xmlDoc.async="false";
  xmlDoc.loadXML(xml);
  }
catch(e)
  {
  try //Firefox, Mozilla, Opera, etc.
    {
    parser=new DOMParser();
    xmlDoc=parser.parseFromString(xml,"text/xml");
    }
  catch(e) {alert(e.message)}
  }

if (xmlDoc.getElementsByTagName(element)[0]!= null){
x=xmlDoc.getElementsByTagName(element)[0].childNodes[0];
return x.nodeValue;
}
else
{
	return '';
}


}
		
//end minipage functions
function trim(stringToTrim) {
	return stringToTrim.replace(/^\s+|\s+$/g,"");
	
}

	

function $_minisites() {
        var els = new Array();
        for (var i=0;i<arguments.length;i++){
	        var el = arguments[i];
	        if (typeof el=='string')
		        el=document.getElementById(el);
	        if (arguments.length==1)
		        return el;
	        els.push(el);
        }
        return els;
  }


function Show(){
		for(var i=arguments.length-1;i>= 0;i--){$(arguments[i]).style.display=""}
}

function Hide(){
		for(var i=arguments.length-1;i>= 0;i--){$(arguments[i]).style.display="none"}
}

function ShowMinisite(){
		for(var i=arguments.length-1;i>= 0;i--){document.getElementById(arguments[i]).style.display=""}
}

function HideMinisite(){
		for(var i=arguments.length-1;i>= 0;i--){document.getElementById(arguments[i]).style.display="none"}
}



     var ProductPrice=[];
      
 function SetPrice(id,val){

        if($('your_price'+id)!=null){
            $('your_price'+id).innerHTML = ProductPrice[val]["your_price"];
            if (ProductPrice[val]["your_price"]==''){Hide('your_price_txt'+id)}
            else {Show('your_price_txt'+id)}   
         };

        if($('you_save'+id)!=null){
            $('you_save'+id).innerHTML = ProductPrice[val]["you_save"];
        };
  
    
        if(ProductPrice[val]["you_save"] == ''){   
            Hide('you_save_txt'+id)
         }
            else 
         {
             Show('you_save_txt'+id)
         }    
       

        if($('reg_price'+id)!=null){
            $('reg_price'+id).innerHTML = ProductPrice[val]["reg_price"]
            if(ProductPrice[val]["reg_price"]==''){Hide('reg_price_txt'+id)}
            else {Show('reg_price_txt'+id)} 
            };

 }
 
 function SetPriceMinisites(id,val){
	 
        if( document.getElementById('your_price'+id)!=null){
             document.getElementById('your_price'+id).innerHTML = ProductPrice[val]["your_price"];
            if (ProductPrice[val]["your_price"]==''){HideMinisite('your_price_txt'+id);
																											HideMinisite('your_price'+id)}
            else {ShowMinisite('your_price_txt'+id);
									ShowMinisite('your_price'+id)}   
         };

        if( document.getElementById('you_save'+id)!=null){
             document.getElementById('you_save'+id).innerHTML = ProductPrice[val]["you_save"];
						 
						 if(ProductPrice[val]["you_save"] == ''){
							  	if( document.getElementById('you_save_txt'+id)!=null){
            					HideMinisite('you_save_txt'+id);}
									HideMinisite('you_save'+id)
         				}
            	else 
         			{
								if( document.getElementById('you_save_txt'+id)!=null){
             					ShowMinisite('you_save_txt'+id);}
						 		ShowMinisite('you_save'+id)
         			}    
        };
        if( document.getElementById('reg_price'+id)!=null){
             document.getElementById('reg_price'+id).innerHTML = ProductPrice[val]["reg_price"]
					if(ProductPrice[val]["reg_price"]==''){HideMinisite('reg_price_txt'+id);
																								HideMinisite('reg_price'+id)}
            else {ShowMinisite('reg_price_txt'+id);
									ShowMinisite('reg_price'+id)} 
            };
						
						//======================
						
					if( document.getElementById('1your_price'+id)!=null){
             document.getElementById('1your_price'+id).innerHTML = ProductPrice[val]["your_price"];
            if (ProductPrice[val]["your_price"]==''){HideMinisite('1your_price_txt'+id);
																											HideMinisite('1your_price'+id)}
            else {ShowMinisite('1your_price_txt'+id);
									ShowMinisite('1your_price'+id)}   
         };

        if( document.getElementById('1you_save'+id)!=null){
             document.getElementById('1you_save'+id).innerHTML = ProductPrice[val]["you_save"];
						 
						 if(ProductPrice[val]["you_save"] == ''){
							  	if( document.getElementById('1you_save_txt'+id)!=null){
            					HideMinisite('1you_save_txt'+id);}
									HideMinisite('1you_save'+id)
         				}
            	else 
         			{
								if( document.getElementById('1you_save_txt'+id)!=null){
             					ShowMinisite('1you_save_txt'+id);}
						 		ShowMinisite('1you_save'+id)
         			}    
        };
        if( document.getElementById('1reg_price'+id)!=null){
             document.getElementById('1reg_price'+id).innerHTML = ProductPrice[val]["reg_price"]
					if(ProductPrice[val]["reg_price"]==''){HideMinisite('1reg_price_txt'+id);
																								HideMinisite('1reg_price'+id)}
            else {ShowMinisite('1reg_price_txt'+id);
									ShowMinisite('1reg_price'+id)} 
            };
						
			if( document.getElementById('1reg_price'+id)!=null){
             document.getElementById('1reg_price'+id).innerHTML = ProductPrice[val]["reg_price"]
					if(ProductPrice[val]["reg_price"]==''){HideMinisite('1reg_price_txt'+id);
																								HideMinisite('1reg_price'+id)}
            else {ShowMinisite('1reg_price_txt'+id);
									ShowMinisite('1reg_price'+id)} 
            };
						
				
					if( document.getElementById('select_menu'+id)!=null){
						document.getElementById('select_menu'+id).value = val;
					}
					if( document.getElementById('1select_menu'+id)!=null){
						document.getElementById('1select_menu'+id).value = val;
					}


 }
 
 
 function SetPriceOnlyForDiscount(id,val){
	 
	if(ProductPrice[val]["you_save"] != '') {
	 
        if( document.getElementById('your_price'+id)!=null){
             document.getElementById('your_price'+id).innerHTML = ProductPrice[val]["your_price"];
            if (ProductPrice[val]["your_price"]==''){HideMinisite('your_price_txt'+id);
																											HideMinisite('your_price'+id)}
            else {ShowMinisite('your_price_txt'+id);
									ShowMinisite('your_price'+id)}   
         };

        if( document.getElementById('you_save'+id)!=null){
             document.getElementById('you_save'+id).innerHTML = ProductPrice[val]["you_save"];
						 
						 if(ProductPrice[val]["you_save"] == ''){
							  	if( document.getElementById('you_save_txt'+id)!=null){
            					HideMinisite('you_save_txt'+id);}
									HideMinisite('you_save'+id)
         				}
            	else 
         			{
								if( document.getElementById('you_save_txt'+id)!=null){
             					ShowMinisite('you_save_txt'+id);}
						 		ShowMinisite('you_save'+id)
         			}    
        };
        if( document.getElementById('reg_price'+id)!=null){
             document.getElementById('reg_price'+id).innerHTML = ProductPrice[val]["reg_price"]
					if(ProductPrice[val]["reg_price"]==''){HideMinisite('reg_price_txt'+id);
																								HideMinisite('reg_price'+id)}
            else {ShowMinisite('reg_price_txt'+id);
									ShowMinisite('reg_price'+id)} 
            };		
						
	}
	else
	{
		if( document.getElementById('your_price'+id)!=null){
					HideMinisite('you_save_txt'+id);
					HideMinisite('you_save'+id)}
		if( document.getElementById('reg_price'+id)!=null){
					HideMinisite('reg_price_txt'+id);
					HideMinisite('reg_price'+id)}
		if( document.getElementById('you_save'+id)!=null){
					HideMinisite('your_price_txt'+id);
					HideMinisite('your_price'+id)}
	}

}





// JavaScript Document

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}



function open_popup(theURL) { //v2.0
 MM_openBrWindow(theURL,'','scrollbars=yes,resizable=yes,width=520,height=500');
}

function open_popup_stores(theURL) { //v2.0
 MM_openBrWindow(theURL,'','scrollbars=yes,resizable=yes,width=675,height=500');
}

function open_popup_w8(theURL) { //v2.0
 MM_openBrWindow(theURL,'','scrollbars=yes,resizable=yes,width=970,height=600');
}

function PopupPic(sPicURL) {
     window.open( 'popup_image.asp?url=' + sPicURL, "",  "resizable=1,HEIGHT=200,WIDTH=200");
}

function hideDiv(pass) { 
var divs = document.getElementsByTagName('div'); 
for(i=0;i<divs.length;i++){ 
if(divs[i].id.match(pass)){//if they are 'see' divs 
if (document.getElementById) // DOM3 = IE5, NS6 
divs[i].style.visibility="hidden";// show/hide 
else 
if (document.layers) // Netscape 4 
document.layers[divs[i]].display = 'hidden'; 
else // IE 4 
document.all.hideshow.divs[i].visibility = 'hidden'; 
} 
} 
} 

function showDiv(pass) { 
var divs = document.getElementsByTagName('div'); 
for(i=0;i<divs.length;i++){ 
if(divs[i].id.match(pass)){ 
if (document.getElementById) 
divs[i].style.visibility="visible"; 
else 
if (document.layers) // Netscape 4 
document.layers[divs[i]].display = 'visible'; 
else // IE 4 
document.all.hideshow.divs[i].visibility = 'visible'; 
} 
} 
} 


function changeclass(id, newClass) {

identity=document.getElementById(id);
identity.className=newClass;

}

function changevalue(id, newvalue) {

identity=document.getElementById(id);
identity.value=newvalue;

}

function changestyle(id, ifWrite) {
	identity = document.getElementById(id);
	if (ifWrite == 1)
		identity.style.border = '2px solid red';
    else if (ifWrite == 2)
    	identity.style.border = '2px inset #cccccc';
	else
		identity.className = '';
}

function changestyle_div(id, ifWrite) {
	identity=document.getElementById(id);
	if (ifWrite == 1)
		identity.style.border='2px solid red';
	else
		identity.style.border='none';
}

function isValidEmail(str) {
   return ( str.indexOf("@") > 0);
 
}

function ClickEmail(textbox_name)
 {
if (isValidEmail(textbox_name)) 
{
return(textbox_name)
}
else
{
return(' ')
}
}


function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
		
}

function opacity(id, opacStart, opacEnd, millisec) {
	//speed for each frame
	var speed = Math.round(millisec / 100);
	var timer = 0;

	//determine the direction for the blending, if start and end are the same nothing happens
	if(opacStart > opacEnd) {
		for(i = opacStart; i >= opacEnd; i--) {
			setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
			timer++;
		}
	} else if(opacStart < opacEnd) {
		for(i = opacStart; i <= opacEnd; i++)
			{
			setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
			timer++;
		}
	}
}

//change the opacity for different browsers
function changeOpac(opacity, id) {
	var object = document.getElementById(id).style; 
	object.opacity = (opacity / 100);
	object.MozOpacity = (opacity / 100);
	object.KhtmlOpacity = (opacity / 100);
	object.filter = "alpha(opacity=" + opacity + ")";
}

function shiftOpacity(id, millisec) {
	//if an element is invisible, make it visible, else make it ivisible
	if(document.getElementById(id).style.opacity == 0) {
		opacity(id, 0, 100, millisec);
	} else {
		opacity(id, 100, 0, millisec);
	}
}

function blendimage(divid, imageid, imagefile, millisec) {
	var speed = Math.round(millisec / 100);
	var timer = 0;
	
	//set the current image as background
	document.getElementById(divid).style.backgroundImage = "url(" + document.getElementById(imageid).src + ")";
	
	//make image transparent
	changeOpac(0, imageid);
	
	//make new image
	document.getElementById(imageid).src = imagefile;

	//fade in image
	for(i = 0; i <= 100; i++) {
		setTimeout("changeOpac(" + i + ",'" + imageid + "')",(timer * speed));
		timer++;
	}
}

function currentOpac(id, opacEnd, millisec) {
	//standard opacity is 100
	var currentOpac = 100;
	
	//if the element has an opacity set, get it
	if(document.getElementById(id).style.opacity < 100) {
		currentOpac = document.getElementById(id).style.opacity * 100;
	}

	//call for the function that changes the opacity
	opacity(id, currentOpac, opacEnd, millisec)
}

function open_popup_wide(theURL) { //v2.0
 MM_openBrWindow(theURL,'','scrollbars=yes,resizable=yes,width=700,height=500');
}

function open_popup_wide_2(theURL) { //v2.0
 MM_openBrWindow(theURL,'','scrollbars=yes,resizable=yes,width=1000,height=800');
}

function open_popup_full_screen(theURL) { //v2.0
var width=screen.availWidth;
var height=screen.availHeight;
 MM_openBrWindow(theURL,'','scrollbars=yes,resizable=yes,width='+ width +',height='+ height+'');
}

function showDiv_display(pass) { 

var divs = document.getElementsByTagName('div'); 
for(i=0;i<divs.length;i++){ 
if(divs[i].id.match(pass)){ 
if (document.getElementById) 
divs[i].style.display="block"; 
} 
} 
} 


function hideDiv_display(pass) { 

var divs = document.getElementsByTagName('div'); 
for(i=0;i<divs.length;i++){ 
if(divs[i].id.match(pass)){ 
if (document.getElementById) 
divs[i].style.display="none"; 
} 
} 
}




function add_to_cart_new_minisite(pid, ptype, atc, select_id) {
    
    var op_id = '';
    var _this;
    var inx = 0;
   
    if(document.getElementById(select_id)!=null){
        _this = document.getElementById(select_id);
        inx = _this.selectedIndex;
        op_id = _this.options[inx].value;
    }

    var sLink='cart_add.asp?pid=' + pid + '&ptype='+ ptype +'&opid=' + op_id + '&atc='+ atc;
		
    document.location.href=sLink;

}
/*
function XXX__add_to_cart_new_minisite(pid, ptype, atc) {
    
    var op_id = '';
  
	alert(op_id);
     
    var sLink='cart_add.asp?pid=' + pid + '&ptype='+ ptype +'&opid=' + op_id + '&atc='+ atc;
		
    
    document.location.href=sLink;

}*/

function add_to_cart_new(pid, ptype, atc) {
    
    var op_id = '';
    var ddl = 'select_menu' + pid;
    var _this;
    var inx = 0;
   
    if($(ddl)!=null){
 
        _this = $(ddl);
        inx = _this.selectedIndex;
        op_id = _this.options[inx].value;
    }
     
    var sLink='cart_add.asp?pid=' + pid + '&ptype='+ ptype +'&opid=' + op_id + '&atc='+ atc;
		
    
    document.location.href=sLink;

}

function add_to_cart_redirect_back(pid, ptype, cid, tn, id1, id2) {
    
    var op_id = '';
    var ddl = 'select_menu' + pid;
    var _this;
    var inx = 0;
   
    if(document.getElementById(ddl)!=null){
 
        _this = document.getElementById(ddl);
        inx = _this.selectedIndex;
        op_id = _this.options[inx].value;
    }
     
    var sLink='cart_add_redirect_back.asp?pid=' + pid + '&ptype='+ ptype +'&opid=' + op_id + '&cid='+ cid+ '&tn='+ tn+ '&id1='+ id1+ '&id2='+ id2;
		
    document.location.href=sLink;

}

function add_to_cart_redirect(pid, ptype, cid, tn, id1, id2, q) {
    
    var op_id = '';
    var ddl = 'select_menu' + pid;
    var _this;
    var inx = 0;
   
    if(document.getElementById(ddl)!=null){
 
        _this = document.getElementById(ddl);
        inx = _this.selectedIndex;
        op_id = _this.options[inx].value;
    }
     
    var sLink='cart_add_redirect_back.asp?pid=' + pid + '&ptype='+ ptype +'&opid=' + op_id + '&cid='+ cid+ '&tn='+ tn+ '&id1='+ id1+ '&id2='+ id2+ '&q='+ q;
		
    document.location.href=sLink;

}

 
function open_page_kredit_bottom(kredit, spec) {
    
    var st_anuitet = '';
    var nbr_obrok = document.getElementById('installment_number_bottom');
		var payment = document.getElementById('payment_type_bottom');
		var payment_value ='';
    var _this;
    var inx = 0;
    if(nbr_obrok!=null){
        inx = nbr_obrok.selectedIndex;
        st_anuitet = nbr_obrok.options[inx].value;
    }
		
		if(payment!=null){
        inx_p = payment.selectedIndex;
        payment_value = payment.options[inx_p].value;
    }
		
     
    var sLink='popup_kredit.asp?cn=Installements&kredit=' + kredit + '&st_anuitet='+ st_anuitet+'&spec='+spec+'&payment='+payment_value;
		
    open_popup(sLink);

}
function open_page_kredit_top(kredit, spec) {
    
    var st_anuitet = '';
    var nbr_obrok = document.getElementById('installment_number_top');
		var payment = document.getElementById('payment_type_top');
		var payment_value ='';
    var _this;
    var inx = 0;
    if(nbr_obrok!=null){
        inx = nbr_obrok.selectedIndex;
        st_anuitet = nbr_obrok.options[inx].value;
    }
		
		if(payment!=null){
        inx_p = payment.selectedIndex;
        payment_value = payment.options[inx_p].value;
    }
		
     
    var sLink='popup_kredit.asp?cn=Installements&kredit=' + kredit + '&st_anuitet='+ st_anuitet+'&spec='+spec+'&payment='+payment_value;
		
    open_popup(sLink);

}
function open_page_kredit(kredit, spec) {
    
    var st_anuitet = '';
    var nbr_obrok = document.getElementById('installment_number');
		var payment = document.getElementById('payment_type');
		var payment_value ='';
    var _this;
    var inx = 0;
    if(nbr_obrok!=null){
        inx = nbr_obrok.selectedIndex;
        st_anuitet = nbr_obrok.options[inx].value;
    }
		
		if(payment!=null){
        inx_p = payment.selectedIndex;
        payment_value = payment.options[inx_p].value;
    }
		
     
    var sLink='popup_kredit.asp?cn=Installements&kredit=' + kredit + '&st_anuitet='+ st_anuitet+'&spec='+spec+'&payment='+payment_value;
		
    open_popup(sLink);

}

function open_page_kredit_intall(kredit, spec, st_anuitet) {
     
    var sLink='popup_kredit.asp?kredit=' + kredit + '&st_anuitet='+ st_anuitet+'&spec='+spec;

    open_popup(sLink);

}


function open_minipage_kredit(nbr_instalments, spec, select_id) {
    
    var st_anuitet = nbr_instalments;
		
		 var op_id = '';
    var _this;
    var inx = 0;
   
    if($_minisites(select_id)!=null){
        _this = $_minisites(select_id);
        inx = _this.selectedIndex;
        op_id = _this.options[inx].value;
    }
		
		
    var sLink='popup_kredit_minipage.asp?op_id=' + op_id + '&st_anuitet='+ st_anuitet+'&spec='+spec;
		
    open_popup(sLink);

}


function open_page_kredit_minisite(kredit, spec) {
    
    var st_anuitet = '';
    var nbr_obrok = document.getElementById('instal_1');
    var _this;
    var inx = 0;
    if(nbr_obrok!=null){
        inx = nbr_obrok.selectedIndex;
        st_anuitet = nbr_obrok.options[inx].value;
    }
     

    var sLink='popup_kredit.asp?kredit=' + kredit + '&st_anuitet='+ install_number+'&spec='+spec;

		
    open_popup(sLink);

}


function open_page_kredit_kartica(kredit, spec) {
    
    var st_anuitet = '';
    var nbr_obrok = document.getElementById('installment_number');
		var payment = document.getElementById('payment_type');
		var payment_value ='';
    var _this;
    var inx = 0;
    if(nbr_obrok!=null){
        inx = nbr_obrok.selectedIndex;
        st_anuitet = nbr_obrok.options[inx].value;
    }
		
		if(payment!=null){
        inx_p = payment.selectedIndex;
        payment_value = payment.options[inx_p].value;
    }
     
    var sLink='popup_kredit.asp?kredit=' + kredit + '&st_anuitet='+ st_anuitet+'&spec='+spec+'&payment='+payment_value;
		
    open_popup(sLink);

}

function open_page_kredit_kartica_top(kredit, spec) {
    
    var st_anuitet = '';
    var nbr_obrok = document.getElementById('installment_number_top');
		var payment = document.getElementById('payment_type_top');
		var payment_value ='';
    var _this;
    var inx = 0;
    if(nbr_obrok!=null){
        inx = nbr_obrok.selectedIndex;
        st_anuitet = nbr_obrok.options[inx].value;
    }
		
		if(payment!=null){
        inx_p = payment.selectedIndex;
        payment_value = payment.options[inx_p].value;
    }
     
    var sLink='popup_kredit.asp?kredit=' + kredit + '&st_anuitet='+ st_anuitet+'&spec='+spec+'&payment='+payment_value;
		
    open_popup(sLink);

}

function open_page_kredit_kartica_bottom(kredit, spec) {
    
    var st_anuitet = '';
    var nbr_obrok = document.getElementById('installment_number_bottom');
		var payment = document.getElementById('payment_type_bottom');
		var payment_value ='';
    var _this;
    var inx = 0;
    if(nbr_obrok!=null){
        inx = nbr_obrok.selectedIndex;
        st_anuitet = nbr_obrok.options[inx].value;
    }
		
		if(payment!=null){
        inx_p = payment.selectedIndex;
        payment_value = payment.options[inx_p].value;
    }
     
    var sLink='popup_kredit.asp?kredit=' + kredit + '&st_anuitet='+ st_anuitet+'&spec='+spec+'&payment='+payment_value;
		
    open_popup(sLink);

}




function open_popup_center(theURL) { //v2.0

var w = 640, h = 480;
if (parseInt(navigator.appVersion)>3) {
 w = screen.width;
 h = screen.height;
}
else if (navigator.appName == "Netscape" 
    && parseInt(navigator.appVersion)==3
    && navigator.javaEnabled()
   ) 
{
 var jToolkit = java.awt.Toolkit.getDefaultToolkit();
 var jScreenSize = jToolkit.getScreenSize();
 w = jScreenSize.width;
 h = jScreenSize.height;
}



var popW = 520, popH = 500;

var leftPos = (w-popW)/2, topPos = (h-popH)/2;


 MM_openBrWindow(theURL,'','scrollbars=yes,resizable=yes,width=' + popW + ',height='+popH+',top='+topPos+',left='+leftPos);
}



function hideDiv2(pass) { 
var divs = document.getElementsByTagName('div'); 
for(i=0;i<divs.length;i++){ 
if(divs[i].id.match(pass)){//if they are 'see' divs 
if (document.getElementById) // DOM3 = IE5, NS6 
divs[i].style.display="none";// show/hide 
else 
if (document.layers) // Netscape 4 
document.layers[divs[i]].display = 'none'; 
else // IE 4 
document.all.hideshow.divs[i].display = 'none'; 
} 
} 
} 


function showDiv2(pass) { 
var divs = document.getElementsByTagName('div'); 
for(i=0;i<divs.length;i++){ 
if(divs[i].id.match(pass)){ 
if (document.getElementById) 
divs[i].style.display="block"; 
else 
if (document.layers) // Netscape 4 
document.layers[divs[i]].display = 'block'; 
else // IE 4 
document.all.hideshow.divs[i].display = 'block'; 
}
} 
}


function div_obroki_change(id_obrok){


	if (id_obrok == 'bank_credit'){
	showDiv('div_obrok');
	hideDiv('div_kart');}

	
	if (id_obrok == 'credit_card'){
	showDiv('div_kart');
	hideDiv('div_obrok');}
	
	
	if (id_obrok == 'cash'){
	hideDiv('div_kart');
	hideDiv('div_obrok');}
	
	if (id_obrok == 'post'){
	hideDiv2('card_postage_div');
	showDiv2('post_postage_div');
	hideDiv2('card_price_div');
	showDiv2('post_price_div');}
	
	if (id_obrok == 'online'){
	hideDiv2('post_postage_div');
	showDiv2('card_postage_div');
	hideDiv2('post_price_div');
	showDiv2('card_price_div');}
	


}



function div2_obroki_change_si(id_obrok){
 
	var select_id=document.getElementById('obrok');
	
	if (select_id != null) {

		var selIndex = select_id.selectedIndex;

 if (id_obrok == 'bank_credit' ){
	 
select_id.options[1].selected = 1;

 showDiv2('div_obrok');
 hideDiv2('div_kart');
 

 }

 
 if (id_obrok == 'credit_card'){
	 
	 select_id.options[2].selected = 1;
 showDiv2('div_kart');
 hideDiv2('div_obrok');
	 }
 
 
 if (id_obrok == 'cash'){
 hideDiv2('div_kart');
 hideDiv2('div_obrok');}
	}
 
}



function div2_obroki_change(id_obrok){
 
var coupontext=document.getElementById('coupontext');
	
 if (id_obrok == 'bank_credit'){
	
 showDiv2('div_obrok');
 hideDiv2('div_kart');
 
  if (coupontext != null) {
		 document.location.href='engine_cart_coupon.asp?id_obrok=bank_credit&coupontext='+coupontext.value;
	 }
 }

 
 if (id_obrok == 'credit_card'){
 showDiv2('div_kart');
 hideDiv2('div_obrok');
 
   if (coupontext != null) {
		 document.location.href='engine_cart_coupon.asp?id_obrok=credit_card&coupontext='+coupontext.value;
	 }
	 
	 }
 
 
 if (id_obrok == 'cash'){
 hideDiv2('div_kart');
 hideDiv2('div_obrok');
 
   if (coupontext != null) {
		 document.location.href='engine_cart_coupon.asp?id_obrok=cash&coupontext='+coupontext.value;
	 }
	 
	 }
 
 
}



// Flash!
var isIE  = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;

function ControlVersion()
{
	var version;
	var axo;
	var e;

	// NOTE : new ActiveXObject(strFoo) throws an exception if strFoo isn't in the registry

	try {
		// version will be set for 7.X or greater players
		axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
		version = axo.GetVariable("$version");
	} catch (e) {
	}

	if (!version)
	{
		try {
			// version will be set for 6.X players only
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
			
			// installed player is some revision of 6.0
			// GetVariable("$version") crashes for versions 6.0.22 through 6.0.29,
			// so we have to be careful. 
			
			// default to the first public version
			version = "WIN 6,0,21,0";

			// throws if AllowScripAccess does not exist (introduced in 6.0r47)		
			axo.AllowScriptAccess = "always";

			// safe to call for 6.0r47 or greater
			version = axo.GetVariable("$version");

		} catch (e) {
		}
	}

	if (!version)
	{
		try {
			// version will be set for 4.X or 5.X player
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
			version = axo.GetVariable("$version");
		} catch (e) {
		}
	}

	if (!version)
	{
		try {
			// version will be set for 3.X player
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
			version = "WIN 3,0,18,0";
		} catch (e) {
		}
	}

	if (!version)
	{
		try {
			// version will be set for 2.X player
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
			version = "WIN 2,0,0,11";
		} catch (e) {
			version = -1;
		}
	}
	
	return version;
}

// JavaScript helper required to detect Flash Player PlugIn version information
function GetSwfVer(){
	// NS/Opera version >= 3 check for Flash plugin in plugin array
	var flashVer = -1;
	
	if (navigator.plugins != null && navigator.plugins.length > 0) {
		if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
			var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
			var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;
			var descArray = flashDescription.split(" ");
			var tempArrayMajor = descArray[2].split(".");			
			var versionMajor = tempArrayMajor[0];
			var versionMinor = tempArrayMajor[1];
			var versionRevision = descArray[3];
			if (versionRevision == "") {
				versionRevision = descArray[4];
			}
			if (versionRevision[0] == "d") {
				versionRevision = versionRevision.substring(1);
			} else if (versionRevision[0] == "r") {
				versionRevision = versionRevision.substring(1);
				if (versionRevision.indexOf("d") > 0) {
					versionRevision = versionRevision.substring(0, versionRevision.indexOf("d"));
				}
			}
			var flashVer = versionMajor + "." + versionMinor + "." + versionRevision;
		}
	}
	// MSN/WebTV 2.6 supports Flash 4
	else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;
	// WebTV 2.5 supports Flash 3
	else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;
	// older WebTV supports Flash 2
	else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;
	else if ( isIE && isWin && !isOpera ) {
		flashVer = ControlVersion();
	}	
	return flashVer;
}

// When called with reqMajorVer, reqMinorVer, reqRevision returns true if that version or greater is available
function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision)
{
	versionStr = GetSwfVer();
	if (versionStr == -1 ) {
		return false;
	} else if (versionStr != 0) {
		if(isIE && isWin && !isOpera) {
			// Given "WIN 2,0,0,11"
			tempArray         = versionStr.split(" "); 	// ["WIN", "2,0,0,11"]
			tempString        = tempArray[1];			// "2,0,0,11"
			versionArray      = tempString.split(",");	// ['2', '0', '0', '11']
		} else {
			versionArray      = versionStr.split(".");
		}
		var versionMajor      = versionArray[0];
		var versionMinor      = versionArray[1];
		var versionRevision   = versionArray[2];

        	// is the major.revision >= requested major.revision AND the minor version >= requested minor
		if (versionMajor > parseFloat(reqMajorVer)) {
			return true;
		} else if (versionMajor == parseFloat(reqMajorVer)) {
			if (versionMinor > parseFloat(reqMinorVer))
				return true;
			else if (versionMinor == parseFloat(reqMinorVer)) {
				if (versionRevision >= parseFloat(reqRevision))
					return true;
			}
		}
		return false;
	}
}

function AC_AddExtension(src, ext)
{
  if (src.indexOf('?') != -1)
    return src.replace(/\?/, ext+'?'); 
  else
    return src + ext;
}

function AC_Generateobj(objAttrs, params, embedAttrs) 
{ 
  var str = '';
  if (isIE && isWin && !isOpera)
  {
    str += '<object ';
    for (var i in objAttrs)
    {
      str += i + '="' + objAttrs[i] + '" ';
    }
    str += '>';
    for (var i in params)
    {
      str += '<param name="' + i + '" value="' + params[i] + '" /> ';
    }
    str += '</object>';
  }
  else
  {
    str += '<embed ';
    for (var i in embedAttrs)
    {
      str += i + '="' + embedAttrs[i] + '" ';
    }
    str += '> </embed>';
  }

  document.write(str);
}

function AC_FL_RunContent(){
  var ret = 
    AC_GetArgs
    (  arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
     , "application/x-shockwave-flash"
    );
  AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
}

function AC_SW_RunContent(){
  var ret = 
    AC_GetArgs
    (  arguments, ".dcr", "src", "clsid:166B1BCA-3F9C-11CF-8075-444553540000"
     , null
    );
  AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
}

function AC_GetArgs(args, ext, srcParamName, classid, mimeType){
  var ret = new Object();
  ret.embedAttrs = new Object();
  ret.params = new Object();
  ret.objAttrs = new Object();
  for (var i=0; i < args.length; i=i+2){
    var currArg = args[i].toLowerCase();    

    switch (currArg){	
      case "classid":
        break;
      case "pluginspage":
        ret.embedAttrs[args[i]] = args[i+1];
        break;
      case "src":
      case "movie":	
        args[i+1] = AC_AddExtension(args[i+1], ext);
        ret.embedAttrs["src"] = args[i+1];
        ret.params[srcParamName] = args[i+1];
        break;
      case "onafterupdate":
      case "onbeforeupdate":
      case "onblur":
      case "oncellchange":
      case "onclick":
      case "ondblclick":
      case "ondrag":
      case "ondragend":
      case "ondragenter":
      case "ondragleave":
      case "ondragover":
      case "ondrop":
      case "onfinish":
      case "onfocus":
      case "onhelp":
      case "onmousedown":
      case "onmouseup":
      case "onmouseover":
      case "onmousemove":
      case "onmouseout":
      case "onkeypress":
      case "onkeydown":
      case "onkeyup":
      case "onload":
      case "onlosecapture":
      case "onpropertychange":
      case "onreadystatechange":
      case "onrowsdelete":
      case "onrowenter":
      case "onrowexit":
      case "onrowsinserted":
      case "onstart":
      case "onscroll":
      case "onbeforeeditfocus":
      case "onactivate":
      case "onbeforedeactivate":
      case "ondeactivate":
      case "type":
      case "codebase":
      case "id":
        ret.objAttrs[args[i]] = args[i+1];
        break;
      case "width":
      case "height":
      case "align":
      case "vspace": 
      case "hspace":
      case "class":
      case "title":
      case "accesskey":
      case "name":
      case "tabindex":
        ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];
        break;
      default:
        ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];
    }
  }
  ret.objAttrs["classid"] = classid;
  if (mimeType) ret.embedAttrs["type"] = mimeType;
  return ret;
}

function faqshowhide(id){
if (document.getElementById){
obj = document.getElementById(id);
if (obj.style.display == "none"){
obj.style.display = "";
/* window.location.hash='a'+id; */
} else {
obj.style.display = "none";
}
}
}

var bustcachevar=0 //bust potential caching of external pages after initial request? (1=yes, 0=no)
var loadedobjects=""
var rootdomain="http://"+window.location.hostname
var bustcacheparameter=""

function ajaxpage(url, containerid){
var page_request = false
if (window.XMLHttpRequest) // if Mozilla, Safari etc
page_request = new XMLHttpRequest()
else if (window.ActiveXObject){ // if IE
try {
page_request = new ActiveXObject("Msxml2.XMLHTTP")
} 
catch (e){
try{
page_request = new ActiveXObject("Microsoft.XMLHTTP")
}
catch (e){}
}
}
else
return false
page_request.onreadystatechange=function(){
loadpage(page_request, containerid)
}
if (bustcachevar) //if bust caching of external page
bustcacheparameter=(url.indexOf("?")!=-1)? "&"+new Date().getTime() : "?"+new Date().getTime()
page_request.open('GET', url+bustcacheparameter, true)
page_request.send(null)
}

function set_select(name, select_ind) {

var elem=document.getElementsByName(name);



for(var i=0;i<elem.length;i++)
{
	elem[i].selectedIndex = select_ind;
}
	
}

// drop box za email.si uporabnike
var dropboxleft=50;
var dropboxtop=120;
var dropspeed=50//10 //set speed of drop animation (larger=faster)

//Specify display mode. 3 possible values are:
//1) "always"- This makes the fade-in box load each time the page is displayed
//2) "oncepersession"- This uses cookies to display the fade-in box only once per browser session
//3) integer (ie: 5)- Finally, you can specify an integer to display the box randomly via a frequency of 1/integer...
// For example, 2 would display the box about (1/2) 50% of the time the page loads.

var displaymode="always"

///Don't edit beyond here///////////

if (parseInt(displaymode)!=NaN)
var random_num=Math.floor(Math.random()*displaymode)
var ie=document.all
var dom=document.getElementById

function initbox(){
if (!dom&&!ie)
return
crossboxcover=(dom)?document.getElementById("dropinboxcover") : document.all.dropinboxcover
crossbox=(dom)?document.getElementById("dropinbox"): document.all.dropinbox
scroll_top=(ie)? truebody().scrollTop : window.pageYOffset
crossbox.height=crossbox.offsetHeight
crossboxcover.style.height=parseInt(crossbox.height)+"px"
crossbox.style.top=crossbox.height*(-1)+"px"
crossboxcover.style.left=dropboxleft+"px"
crossboxcover.style.top=dropboxtop+"px"
crossboxcover.style.visibility=(dom||ie)? "visible" : "show"
dropstart=setInterval("dropin()",50)
}

function dropin(){
scroll_top=(ie)? truebody().scrollTop : window.pageYOffset
if (parseInt(crossbox.style.top)<0){
crossboxcover.style.top=scroll_top+dropboxtop+"px"
crossbox.style.top=parseInt(crossbox.style.top)+dropspeed+"px"
}
else{
clearInterval(dropstart)
crossbox.style.top=0
}
}

function truebody(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

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 closeCheckEmail(){
var crossboxcover = document.getElementById("dropinboxcover");
if (window.dropstart) clearInterval(dropstart)
crossboxcover.style.visibility="hidden"
}

function checkEmail(id){
//function checkEmail(id, ok, error, klicaj){
if(document.getElementById) { var vpisan_email = document.getElementById(id).value; }
else if ((document.all) && (!document.getElementById)) { var vpisan_email = document.all.id.value; } // ie4
else if (document.layers) { var vpisan_email = document.layers[id].value; } // ns4
else { var vpisan_email = document.all[id].value; }

var error_email = document.getElementById(id);
var vseok = true;

	if(vpisan_email == "" || vpisan_email == null){
		vseok = false;
		return vseok;
	}
	var email = vpisan_email.toLowerCase();

	if(!email.match("@")){
		vseok = false;
		return vseok;
	}

	AtPos = email.indexOf("@")
	StopPos = email.lastIndexOf(".") // dot, pika

	if (AtPos == -1 || StopPos == -1 || AtPos == 0 || StopPos-AtPos <= 1 || StopPos < AtPos || AtPos == email.length || StopPos == email.length) {
		vseok = false;
		return vseok;
	}
		
	var len = email.length;
		var pos = email.lastIndexOf ( '.', len - 1 ) + 1;
		if ((len - pos) > 4) {
			vseok = false;
			return vseok;
		}
		else if((len - pos) < 2) {
			vseok = false;
			return vseok;
		}

var nedovoljenEmail = "@email.si";
//var nedovoljenEmail = /@email.si/;
//nedovoljenEmail = email.search(nedovoljenEmail);
nedovoljenEmail = email.match(nedovoljenEmail);
var emailKoncnica = email.length - StopPos; // 3 more bit
//if(nedovoljenEmail != -1){
	if (nedovoljenEmail != null && emailKoncnica != 3)
	{
		vseok = false;
		return vseok;
	}	

	if(nedovoljenEmail != null && emailKoncnica == 3)
	{
		initbox();
		vseok = false;
		return vseok;
	}
return vseok;
}

id = "newsletter_email";
function disableEnterKey(e)
{
     var key;     
     if(window.event){
          key = window.event.keyCode; //IE
     }
     else {
          key = e.which; //firefox
     }

	if(key == 13 && checkEmail(id) == false){
    	return false;
    }
    else {
		return true;
    }
//return (key != 13);
}

function closeSelect() {
  if ( !document.getElementsByName("select_menu") ) { return false; }

  for (var i in document.getElementsByName("select_menu")) {
      document.getElementsByName("select_menu")[i].style.visibility="hidden"; 
  }
	

}

function openSelect() {

  if ( !document.getElementsByName("select_menu") ) { return false; }
  var str;
  for (var i in document.getElementsByName("select_menu")) {
      document.getElementsByName("select_menu")[i].style.visibility="visible"; 
  } 
	
}

function show_hide_element(id){
	var stil;
	
	stil=document.getElementById(id).style.display;
	
	if (stil=='block' ) {
	document.getElementById(id).style.display='none';
	}
	else
	{
	document.getElementById(id).style.display='block';
	}
	}
	
	
	// countdown

function time_show(id){
	var stil;
	
	stil=document.getElementById(id).style.display;
	
	if (stil=='block' ) {
	}
	else
	{
	document.getElementById(id).style.display='block';
	}
}



function time_hide(id){
	var stil;
	
	stil=document.getElementById(id).style.display;
	
	if (stil=='block' ) {
	document.getElementById(id).style.display='none';
	}

}

function countdown(obj)
{
	this.obj		= obj;
	this.Div		= "clock";
	this.BackColor		= "white";
	this.ForeColor		= "black";
	this.TargetDate		= "12/31/2020 5:00 AM";
	this.DisplayFormat	= "%%D%% Days, %%H%% Hours, %%M%% Minutes, %%S%% Seconds.";
	this.CountActive	= true;
	
	this.DisplayStr;

	this.Calcage		= cd_Calcage;
	this.CountBack		= cd_CountBack;
	this.Setup		= cd_Setup;
}



function cd_Calcage(secs, num1, num2)
{
  s = ((Math.floor(secs/num1))%num2).toString();
  if (s.length < 2) s = "0" + s;
  return (s);
}
function cd_CountBack(secs)
{
if (secs>0) { 
  this.DisplayStr = this.DisplayFormat.replace(/%%D%%/g,	this.Calcage(secs,86400,100000));
  this.DisplayStr = this.DisplayStr.replace(/%%H%%/g,		this.Calcage(secs,3600,24));
  this.DisplayStr = this.DisplayStr.replace(/%%M%%/g,		this.Calcage(secs,60,60));
  this.DisplayStr = this.DisplayStr.replace(/%%S%%/g,		this.Calcage(secs,1,60));
	
	time_show('cat_counter');
}
else
{
	//location.reload(true);
	this.DisplayStr="Čas je potekel! Naročilo je možno samo še brez darila.";
		
	time_hide('cat_nocounter');	
	
	if (document.getElementById("category_timer")!=null){
		document.getElementById("category_timer").className ="category_timer_off";
	}
	
	if (document.getElementById("timer_value")!=null){
		document.getElementById("timer_value").value ="0";
	}
	
	}


	
	
  document.getElementById(this.Div).innerHTML = this.DisplayStr;
  if (this.CountActive) setTimeout(this.obj +".CountBack(" + (secs-1) + ")", 990);
}

function cd_Setup()
{
	var dthen	= new Date(this.TargetDate);
  	var dnow	= new Date(this.NowDate);
	ddiff		= new Date(dthen-dnow);
	gsecs		= Math.floor(ddiff.valueOf()/1000);
	this.CountBack(gsecs);
}

function getCalendarDate()
{
 
   var now         = new Date();
   var monthnumber = now.getMonth()+1;
   var monthday    = now.getDate();
   var year        = now.getYear();
   if(year < 2000) { year = year + 1900; }
	 var hour   = now.getHours();
   var minute = now.getMinutes();
   var second = now.getSeconds();
   var ap = "AM";
   if (hour   > 11) { ap = "PM";             }
   if (hour   > 12) { hour = hour - 12;      }
   if (hour   == 0) { hour = 12;             }
   if (hour   < 10) { hour   = "0" + hour;   }
   if (minute < 10) { minute = "0" + minute; }
   if (second < 10) { second = "0" + second; }
   var dateString =  monthnumber+
                    '/' +
                    monthday +
                    '/' +
                    year +
										' ' +
										hour +
                    ':' +
                    minute +
                    ':' +
                    second +
                    " " +
                    ap;
   return dateString;
}
