			function toggleMe(a){
				var e=document.getElementById(a);
  				if(!e)return true;
  					if(e.style.display=="none"){
    					e.style.display="block";
    					if(a.indexOf("e")==-1) {
							document.getElementById('toggle'+a).style.cursor=="s-resize";
    						document.getElementById('toggle'+a).style.cursor="n-resize";
						}
						if(a.indexOf("e")== true) {
							e.style.display="block";
						}
					} else {
						e.style.display="none";
						if(a.indexOf("e")== -1) {
							document.getElementById('toggle'+a).style.cursor=="n-resize";
   							document.getElementById('toggle'+a).style.cursor="s-resize";
						} 
						if(a.indexOf("e")== true) {
							e.style.display="none";
						}
   					}
				}
/*----------Toggle paymentform---------------------------------------------*/
			function toggleForm(){
				if(document.getElementById('orderForm').style.display=="none"){
					document.getElementById('orderForm').style.display="block";
					document.getElementById('cardForm').style.display="none";
				} else {
					document.getElementById('orderForm').style.display="none";
					document.getElementById('cardForm').style.display="block";
				}
			}
/*----------Open new Window------------------------------------------------*/			
			function closeDiv(a) {
  				document.getElementById(a).style.visibility="hidden";
				document.getElementById(a).style.display="none";
  			}
			function openDiv(a) {
  				document.getElementById(a).style.visibility="visible";
				document.getElementById(a).style.display="block";
  			}

/*----------Open new Window------------------------------------------------*/			
			function newWindow(mypage,w,h) {
				winprops = "'toolbar=no,location=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,width="+w+",height="+h+"'";
				window.open(mypage,'',winprops);
			}

/*----------Search in content-----------------------------------------------*/			
			//	client function  
		    function call_search(c) {
					agent.call('','searchdata','callback_search',c);
					openDiv('found');
		    }
		    // client callback function
		    function callback_search(str) {
				document.getElementById('found').innerHTML = str;
		    }
			var tId = 1;
/*----------Set paymentmethod as cookie--------------------------------------*/			
			function call_paymentmethod(c) {
				agent.call('','setPayment','callback_paymentmethod',c);
			}
			function callback_paymentmethod(str) {
				if (str == 'invoice') {
					document.getElementById('orderForm').style.display="block";
					document.getElementById('cardForm').style.display="none";
				} else if (str == 'card') {
					document.getElementById('orderForm').style.display="none";
					document.getElementById('cardForm').style.display="block";
				}
				window.location.reload();
		    }
/*----------Recalculate cart-------------------------------------------------*/				
			function call_reCalc(c,a,b) {
                if(b==1) {
					//if (document.cardForm.deliAddress.value !='' && document.cardForm.deliZipCode.value !='' && document.cardForm.deliCity.value !='') {
                    	if(a == 2 && (document.getElementById('ddl3DeliveryCountry').value !=""))
	                        agent.call('','reCalc','callback_reCalc',c);
	                    if(a == 2 && (c =="")) {
	                        a = 1;
	                        c = document.getElementById('ddlDeliveryCountry').value;
	                    }
					//}
					if(a == 1 && (document.getElementById('ddl3DeliveryCountry').value ==''))
                       	agent.call('','reCalc','callback_reCalc',c);
	 				
                } else {
					
                    if(a == 2 && (document.getElementById('ddl2DeliveryCountry').value !=""))
                        agent.call('','reCalc','callback_reCalc',c);
                    if(a == 2 && (c =="")) {
                        a = 1;
                        c = document.getElementById('deliveryCountry').value;
                    }
                    if(a == 1 && (document.getElementById('ddl2DeliveryCountry').value ==''))
                        agent.call('','reCalc','callback_reCalc',c);
					}
			}
			function callback_reCalc(str) {
				document.getElementById('calcCart').innerHTML = str;
				//document.cardForm.amount.value = (document.shopd.recalcamount.value);
				//alert(document.cardForm.ddl3DeliveryCountry.value);
				//document.cardForm.ddl3.value = (document.cardForm.ddl3DeliveryCountry.value);
		    }
			
			function setDebiTech() {
				var go = '1';
				if (document.cardForm.billingFirstName.value =='') {
					go = '0';
					document.cardForm.billingFirstName.style.backgroundColor="#ffbcb9";
				}
				if (document.cardForm.billingLastName.value =='') {
					go = '0';
					document.cardForm.billingLastName.style.backgroundColor="#ffbcb9";
				}
				if (document.cardForm.billingAddress.value =='') {
					go = '0';
					document.cardForm.billingAddress.style.backgroundColor="#ffbcb9";
				}
				if (document.cardForm.billingZipCode.value =='') {
					go = '0';
					document.cardForm.billingZipCode.style.backgroundColor="#ffbcb9";
				}
				if (document.cardForm.billingCity.value =='') {
					go = '0';
					document.cardForm.billingCity.style.backgroundColor="#ffbcb9";
				}
				if (document.cardForm.phone.value =='') {
					go = '0';
					document.cardForm.phone.style.backgroundColor="#ffbcb9";
				}
				if (document.cardForm.eMail.value =='') {
					go = '0';
					document.cardForm.eMail.style.backgroundColor="#ffbcb9";
				}	
				if ((document.cardForm.deliAddress.value !='' || document.cardForm.deliZipCode.value !='' || document.cardForm.deliCity.value !='') && document.cardForm.ddl3DeliveryCountry.value =='') {
					go = '0';
					document.cardForm.ddl3DeliveryCountry.style.backgroundColor="#ffbcb9";
				}
				if (document.cardForm.ddl3DeliveryCountry.value !='' && (document.cardForm.deliAddress.value =='' || document.cardForm.deliZipCode.value =='' || document.cardForm.deliCity.value =='')) {
					go = '0';
					if (document.cardForm.deliAddress.value =='')
					document.cardForm.deliAddress.style.backgroundColor="#ffbcb9";
					if (document.cardForm.deliZipCode.value =='')
					document.cardForm.deliZipCode.style.backgroundColor="#ffbcb9";
					if (document.cardForm.deliCity.value =='')
					document.cardForm.deliCity.style.backgroundColor="#ffbcb9";
				}
				if (go == '1') {
					document.cardForm.shipment.value = (document.shipv.shipvalue.value);
					document.cardForm.data.value = (document.shopd.calcd.value);
					document.cardForm.submit();
				}
			}
			
			function setCertitrade() {
				var go = '1';
				if (document.cardForm.cust_name.value =='') {
					go = '0';
					document.cardForm.cust_name.style.backgroundColor="#ffbcb9";
				}
				if (document.cardForm.cust_address1.value =='') {
					go = '0';
					document.cardForm.cust_address1.style.backgroundColor="#ffbcb9";
				}
				if (document.cardForm.cust_zip.value =='') {
					go = '0';
					document.cardForm.cust_zip.style.backgroundColor="#ffbcb9";
				}
				if (document.cardForm.cust_city.value =='') {
					go = '0';
					document.cardForm.cust_city.style.backgroundColor="#ffbcb9";
				}
				if (document.cardForm.cust_phone.value =='') {
					go = '0';
					document.cardForm.cust_phone.style.backgroundColor="#ffbcb9";
				}
				if (document.cardForm.cust_email.value =='') {
					go = '0';
					document.cardForm.cust_email.style.backgroundColor="#ffbcb9";
				}	
				if (go == '1') {
					document.cardForm.submit();
				}
			}
			function setPayEx() {
				var go = '1';
				if (document.cardForm.billingFirstName.value =='') {
					go = '0';
					document.cardForm.billingFirstName.style.backgroundColor="#ffbcb9";
				}
				if (document.cardForm.billingLastName.value =='') {
					go = '0';
					document.cardForm.billingLastName.style.backgroundColor="#ffbcb9";
				}
				if (document.cardForm.billingAddress.value =='') {
					go = '0';
					document.cardForm.billingAddress.style.backgroundColor="#ffbcb9";
				}
				if (document.cardForm.billingZipCode.value =='') {
					go = '0';
					document.cardForm.billingZipCode.style.backgroundColor="#ffbcb9";
				}
				if (document.cardForm.billingCity.value =='') {
					go = '0';
					document.cardForm.billingCity.style.backgroundColor="#ffbcb9";
				}
				if (document.cardForm.billingCountry.value =='') {
					go = '0';
					document.cardForm.billingCountry.style.backgroundColor="#ffbcb9";
				}
				if (document.cardForm.phone.value =='') {
					go = '0';
					document.cardForm.phone.style.backgroundColor="#ffbcb9";
				}
				if (document.cardForm.eMail.value =='') {
					go = '0';
					document.cardForm.eMail.style.backgroundColor="#ffbcb9";
				}
				if ((document.cardForm.deliAddress.value !='' || document.cardForm.deliZipCode.value !='' || document.cardForm.deliCity.value !='') && document.cardForm.ddl3DeliveryCountry.value =='') {
					go = '0';
					document.cardForm.ddl3DeliveryCountry.style.backgroundColor="#ffbcb9";
				}
				if (document.cardForm.ddl3DeliveryCountry.value !='' && (document.cardForm.deliAddress.value =='' || document.cardForm.deliZipCode.value =='' || document.cardForm.deliCity.value =='')) {
					go = '0';
					if (document.cardForm.deliAddress.value =='')
					document.cardForm.deliAddress.style.backgroundColor="#ffbcb9";
					if (document.cardForm.deliZipCode.value =='')
					document.cardForm.deliZipCode.style.backgroundColor="#ffbcb9";
					if (document.cardForm.deliCity.value =='')
					document.cardForm.deliCity.style.backgroundColor="#ffbcb9";
				}	
				if (go == '1') {
				//	document.cardForm.shipment.value = (document.shipv.shipvalue.value);
				//	document.cardForm.data.value = (document.shopd.calcd.value);
					
					document.cardForm.submit();
				}
			}
			
/*----------PrototypeJS------------------------------------------------------*/	
			function getSlide(a,b,c) {
				new Effect.Opacity('main'+b, {
					transition: Effect.Transitions.linear, 
					duration: 0.35, 
					from: 1.0, to: 0.0,
					afterFinish: function(transport) {
						document.getElementById('main'+b).style.visibility='hidden';
						new Ajax.Updater('main'+b, '_slideShowE.pab', {
							method: 'post', 
							parameters: { rank:a, slid:b, showname:c }, 
							onSuccess: function(transport) {
								document.getElementById('main'+b).style.visibility='visible';
								new Effect.Opacity('main'+b, { transition: Effect.Transitions.linear, duration: 0.5, from: 0.0, to: 1.0 });
							}
						})
					}
				});
			
					document.getElementById('preview'+tId).style.opacity =".5";
					document.getElementById('preview'+a).style.opacity ="1";
					document.getElementById('preview'+tId).style.MozOpacity ="0.5";
					document.getElementById('preview'+a).style.MozOpacity ="1.0";
					document.getElementById('preview'+tId).style.filter = "alpha(opacity=50)";
					document.getElementById('preview'+a).style.filter = "alpha(opacity=100)";
					
				tId = a;
			}
			
			function getItemImg(a,b,c) {
				new Effect.Opacity('main'+b, {
					transition: Effect.Transitions.linear, 
					duration: 0.35, 
					from: 1.0, to: 0.0,
					afterFinish: function(transport) {
						document.getElementById('main'+b).style.visibility='hidden';
						new Ajax.Updater('main'+b, '_shopItemImg.pab', {
							method: 'post', 
							parameters: { rank:a, artno:b, cid:c }, 
							onSuccess: function(transport) {
								document.getElementById('main'+b).style.visibility='visible';
								new Effect.Opacity('main'+b, { transition: Effect.Transitions.linear, duration: 0.5, from: 0.0, to: 1.0 });
							}
						})
					}
				});
			
				document.getElementById('preview'+tId).style.opacity ="0.5";
				document.getElementById('preview'+a).style.opacity ="1";
				document.getElementById('preview'+tId).style.MozOpacity ="0.5";
				document.getElementById('preview'+a).style.MozOpacity ="1";
				document.getElementById('preview'+tId).style.filter = "alpha(opacity=50)";
				document.getElementById('preview'+a).style.filter = "alpha(opacity=100)";
					
				tId = a;
			}	
			
			function call_attr(c,d,e,f) {
				a = document.getElementById('attribute').value;
				b = document.getElementById('artsize').value;
				
				new Ajax.Updater('aprice', '_shopFunc.pab', {
					evalScripts: true,
					method: 'post',
					parameters: { attribute:a, size:b, cid:c, iid:d, maxia:e, datacid:f },
					onSuccess: function(transport) {
					}
				});
			}
			
			//test from Ajax till prototype
			/*function call_paymentmethod(c) {
				new Ajax.Updater('', 'setPayment.pab', {
					evalScripts: true,
					method: 'post',
					parameters: { payment:c }
				});
				if (str == 'invoice') {
					document.getElementById('orderForm').style.display="block";
					document.getElementById('cardForm').style.display="none";
				} else if (str == 'card') {
					document.getElementById('orderForm').style.display="none";
					document.getElementById('cardForm').style.display="block";
				}
				window.location.reload();
			}*/