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_old(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($('you_save_txt'+id)!=null){
			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 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 ($('you_save_txt' + id) != null) {
		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);
	};

	if ($('min_install' + id) != null)
		$('min_install' + id).innerHTML = ProductPrice[val]["min_install"];
    
	if ($('min_install_text' + id) != null) {
		if (ProductPrice[val]["min_install"] == '')
			Hide('min_install_text' + id);
		else 
			Show('min_install_text' + id);
	}
}
 
 function SetPrice22(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)}   
         };

alert('1.');

        if($('you_save'+id)!=null){
            $('you_save'+id).innerHTML = ProductPrice[val]["you_save"];
        };
  
 alert('2.');
 
	 	if($('you_save_txt'+id)!=null){
			if(ProductPrice[val]["you_save"] == ''){   
				Hide('you_save_txt'+id)
			 }
				else 
			 {
				 Show('you_save_txt'+id)
			 }    
		}
       
alert('3.');

        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)} 
            };


alert('4.');

if($('min_install'+id)!=null){

            $('min_install'+id).innerHTML = ProductPrice[val]["min_install"]

            if(ProductPrice[val]["min_install"]==''){

				Hide('min_install_text'+id);
				}
            else {

				Show('min_install_text'+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_pdf(theURL) { //v2.0
 MM_openBrWindow(theURL,'','scrollbars=yes,resizable=yes,width=900,height=700');
}

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 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.style.border = '1px solid #30547d';
}

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_pdf(theURL) { //v2.0
 MM_openBrWindow(theURL,'','scrollbars=yes,resizable=yes,width=900,height=700,top=30, left=30');
}

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 add_to_cart_redirect_v2(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;
		
		alert(sLink);
    document.location.href=sLink;

}


function add_to_cart_redirect_special(pid, ptype, cid, tn, id1, id2, q, opid) {
   
     
    var sLink='cart_add_redirect_back.asp?pid=' + pid + '&ptype='+ ptype +'&opid=' + opid + '&cid='+ cid+ '&tn='+ tn+ '&id1='+ id1+ '&id2='+ id2+ '&q='+ q;
		
    document.location.href=sLink;

}

 
function open_page_kredit(kredit, spec) {
    
    var st_anuitet = '';
    var nbr_obrok = document.getElementById('nbr_obrok');
		var payment = document.getElementById('obrok');
		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_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('nbr_obrok_kartica');
		var payment = document.getElementById('obrok');
		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 loadpage(page_request, containerid){
if (page_request.readyState == 4 && (page_request.status==200 || window.location.href.indexOf("http")==-1))
document.getElementById(containerid).innerHTML=page_request.responseText
}

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 change_div_display_priority(){
		
		
		
		if (document.form_cart1.priority_delivery.checked==true){
		showDiv_display('div_uk_postage_priority');
		hideDiv_display('div_uk_postage_normal');
		showDiv_display('div_uk_price_total_priority');
		hideDiv_display('div_uk_price_total_normal');
		}
		else
		{
		hideDiv_display('div_uk_postage_priority');
		showDiv_display('div_uk_postage_normal');
		hideDiv_display('div_uk_price_total_priority');
		showDiv_display('div_uk_price_total_normal');
		}
}

function open_cart (product1, product2)
{
	var url;
	document.getElementById("popup_cart").style.visibility="visible"; 
	url = 'popup_cart_trendset.asp?prod1='+product1+'&prod2='+product2;
  ajaxpage(url,'popup_cart');
	
}
function close_cart ()
{
	document.getElementById("popup_cart").style.visibility="hidden"; 
	
}

function open_cart_upsell (productID, pid, pid2, tn_redirect, q)
{
	var opidID = '';
    var ddl = 'select_menu' + productID;
    var _this;
    var inx = 0;
   
    if(document.getElementById(ddl)!=null){
 
        _this = document.getElementById(ddl);
        inx = _this.selectedIndex;
        opidID = _this.options[inx].value;
    }
	
	var url;
	document.getElementById("popup_cart_upsell").style.visibility="visible"; 
	url = 'inc_minisite_popup_product.asp?productID='+productID+'&opidID='+opidID+'&pid='+pid+'&pid2='+pid2+'&tn_redirect='+tn_redirect+'&q='+q;

  ajaxpage(url,'popup_cart_upsell');
	
}

function changeOpid (trend_single_id, trend_double_id)
{
	var q = 1;
	var url;
	var choosePid =0;
	var radioObj;
	
	if (document.getElementById("q") != null)
	{
		q = document.getElementById("q").value;
	}
	
	if (document.getElementsByName("pids") != null)
	{
		radioObj = document.getElementsByName("pids");
		radioLength = radioObj.length;
	
		for(var i = 0; i < radioLength; i++) {
			if(radioObj[i].checked) {
				choosePid = radioObj[i].value;
			}
		}
	}
					
			if (choosePid == trend_single_id)
			{
				showDiv_display('opid'+trend_single_id);
				if (document.getElementById("opid"+trend_double_id) != null){
				hideDiv_display('opid'+trend_double_id);
				}
				showDiv_display('price'+trend_single_id);
				if (document.getElementById("opid"+trend_double_id) != null){
				hideDiv_display('price'+trend_double_id);
				}
				document.getElementById('pids_' + choosePid).checked = true;
				
			}
			else
			{
				if (document.getElementById("opid"+trend_double_id) != null){
				showDiv_display('opid'+trend_double_id);
				}
				hideDiv_display('opid'+trend_single_id);
				if (document.getElementById("opid"+trend_double_id) != null){
				showDiv_display('price'+trend_double_id);
				}
				hideDiv_display('price'+trend_single_id);
				document.getElementById('pids_' + choosePid).checked = true;
			}
			
	
	if (document.getElementById("selectPrice") != null)
	{
		url = 'ajax_trendset_price.asp?checkTrend='+choosePid+'&trend_single_id='+trend_single_id+'&trend_double_id='+trend_double_id+'&q='+q;
  		ajaxpage(url,'selectPrice');
	}
			
			
					
}

function ClickOnImage(pid, id, i)
{
			document.getElementById('opid' + id).checked = true;
}			
				
function checkOrderFormTrend(tn,id1,id2){
	var pids = document.getElementsByName("pids");
	var pidsLength = pids.length;
	var ptype = '';
	
	for(var i = 0; i < pidsLength; i++){
		if(pids[i].checked){
			selectPid = pids[i].value;
		}
	}
		
	var opid = document.getElementsByName('opid'+selectPid);
	var opidLength = opid.length;
	var selectOpid = 0;

	for(var i = 0; i < opidLength; i++){
		if(opid[i].checked){
			selectOpid = opid[i].value;
		}
	}

	var selectIndexQ = document.getElementById('q').selectedIndex;
	var selectQ = document.getElementById('q').options[selectIndexQ].value;

	if (selectOpid==0){
		showDiv_display('form_error');
	}else{
		var sLink='cart_add_redirect_back.asp?pid=' + selectPid + '&ptype='+ ptype +'&opid=' + selectOpid + '&cid=0&tn='+ tn+ '&id1='+ id1+ '&id2='+ id2+ '&q='+ selectQ;
		document.location.href=sLink;
	}
}

function goToLink(obj, url)
{

obj.target='_blank';
obj.href=url;

}


function set_select_v2(name, select_ind) {

var elem=document.getElementsByName(name);
for(var i=0;i<elem.length;i++)
{elem[i].selectedIndex = select_ind}
}



 function SetPriceMinisites_double(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)
				{
             		Minisite('you_save_txt'+id);
				}
					HideShowMinisite('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;
		}


 }
 
 
 /* Flash check radio */
function setVal(id)
{
	if (document.getElementById('answer') != null)
	{
		document.getElementById('answer').value = id;
		
		window.location.hash= 'jump';

	};
	

}
 
 
//###################AJAX MX email VALIDATE####################
function validateEmail(fld) {

    var tfld = trim(fld.value);                        // value of field with whitespace trimmed off
			
			
    var emailFilter = /^[^@]+@[^@.]+\.[^@]*\w\w$/ ;
    var illegalChars= /[\(\)\<\>\,\&\=\#\;\:\\\"\[\]]/ ;
		var error_mail = 0;
		
    if (tfld.value == "") {
   		
		error_mail = 1;
    } else if (!emailFilter.test(tfld)) {              //test email for illegal characters
	
		error_mail = 1;
    } else if (tfld.match(illegalChars)) {
		error_mail = 1;	
    } else {
				error_mail = 0;
    }
    return error_mail;
}


function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}



//###################Email VALIDATE####################


 