	function stop(arr)
	{
		if(arr)
			clearInterval(arr);
	}

function val_search()
{
 if (document.searchForm.xSearch.value!="") return true;
 else {alert('Please input a keyword to search.'); return false;}
}

function pop_still(url) 
{
	var name='';
	var args='WIDTH=500,HEIGHT=500,scrollbars=yes';
	if (typeof(popupWin1) != "object")
	{
	 popupWin1 = window.open(url, name, args);
	} 
	else 
	{
		if (!popupWin1.closed)
		{ 
		popupWin1.location.href = url;
		} 
		else 
		{
		popupWin1 = window.open(url,  name, args);
		}
	}
	popupWin1.focus();
	
}

function on_off(ob)
{
	if (document.getElementById) 
	{	
		 if (document.getElementById(ob).style.display=='none')
		  {  
		   document.getElementById(ob).style.display='';
//		   document.location=lx;
          }
		 else
		  {
		   document.getElementById(ob).style.display='none';  
		  }
	}
	if(document.layers) 
	{ 
		if (document.layers[ob].style.display=='none')
		  {  
		   document.layers[ob].style.display='';
		   //document.location=lx;
		  }
		 else
		  {
		   document.layers[ob].style.display='none';  
		  }	  
	}
}

function on_off_contact(ob)
{
	if (document.getElementById) 
	{	
		   document.getElementById('default').style.display='none';
		   document.getElementById('shipping').style.display='none';
		   document.getElementById('ordering').style.display='none';
		   document.getElementById('samples').style.display='none';
		   document.getElementById('payment').style.display='none';
		   document.getElementById('payment_opt').style.display='none';
		   document.getElementById('artwork').style.display='none';
		   document.getElementById('website').style.display='none';
		   document.getElementById('refp').style.display='none';
		   document.getElementById('pp').style.display='none';
		   document.getElementById('aff').style.display='none';
		   document.getElementById('contact').style.display='none';
		   document.getElementById('other').style.display='none';
		   document.getElementById(ob).style.display='';
	}
	if(document.layers) 
	{ 
		   document.layers['default'].style.display='none';
		   document.layers['shipping'].style.display='none';
		   document.layers['ordering'].style.display='none';
		   document.layers['samples'].style.display='none';
		   document.layers['payment'].style.display='none';
		   document.layers['payment_opt'].style.display='none';
		   document.layers['artwork'].style.display='none';
		   document.layers['website'].style.display='none';
		   document.layers['refp'].style.display='none';
		   document.layers['pp'].style.display='none';
		   document.layers['aff'].style.display='none';
		   document.layers['contact'].style.display='none';
		   document.layers['other'].style.display='none';
		   document.layers[ob].style.display='';
	}
}

function pop_up(url) 
{
	var name='';
	var args='WIDTH=679,HEIGHT=600,scrollbars=yes';
	if (typeof(popupWin1) != "object")
	{
	 popupWin1 = window.open(url, name, args);
		if (url!='http://www.water4fish.co.uk/default-print.php')
			{
			popupWin1.print();
			}
	} 
	else 
	{
		if (!popupWin1.closed)
		{ 
		popupWin1.location.href = url;
		popupWin1.print();
		} 
		else 
		{
		popupWin1 = window.open(url,  name, args);
		if (url!='http://www.water4fish.co.uk/default-print.php')
			{
			popupWin1.print();
			}
		}
	}
	popupWin1.focus();
	
}
function addfav(url,title)
   {
   if (document.all)
      {
      window.external.AddFavorite (url,title)
      }
   }
function stopError() {
  return true;
}

window.onerror = stopError;

			function recalcPrice(productID) {
				eval("thisPrice = baseprice"+productID+";");
				eval("thisPriceExTax = basepriceExTax"+productID+";");
				eval("thisPriceIncTax = basepriceIncTax"+productID+";");
				eval("thisPriceTax = basepriceTax"+productID+";");
				eval("thisOOPrice = oobaseprice"+productID+";");
				eval("thisOOPriceExTax = oobasepriceExTax"+productID+";");
				eval("thisOOPriceIncTax = oobasepriceIncTax"+productID+";");
				eval("thisOOPriceTax = oobasepriceTax"+productID+";");
				currentValues = new Array(efcount);
				eval ("qtybox = document.productForm"+productID+".qty"+productID+";");
				qty = 1;
				if (typeof qtybox != "undefined") {
					eval("qtyboxtype = qtybox.type");
					if (qtyboxtype == "select-one") {
						qty = qtybox.options[qtybox.selectedIndex].text;
					}
					if (qtyboxtype == "text") {
						qty = qtybox.value;
					}
				}
	
				for (f = 0; f < efcount; f++) {
					currentValues[extrafields[f]] = "";
					eval("result = document.productForm"+productID+"."+extrafields[f]+";");
					if (extrafieldstype[f] == "CHECKBOXES") {
						eval("result = document.productForm"+productID+"."+extrafields[f]+"1;");
					}
					if (extrafieldstype[f] == "RADIOBUTTONS") {
						if (eval("document.productForm"+productID+"."+extrafields[f]+";")) {
							eval("result = document.productForm"+productID+"."+extrafields[f]+".length;");
							if (result > 0) {
								result = "radio";
							}
						}
					}
						
					if (typeof result != "undefined" || result=="radio") {
						if (result != "radio") {
							eval("fieldtype = result.type;");
						} else {
							fieldtype = "radio";
						}
						if (fieldtype=="select-one") {
						
						eval("temp = document.productForm"+productID+"."+extrafields[f]+";");
							if(temp)
							{
								if(temp.style.display == '')
								{
									content = result.options[result.selectedIndex].value;
										currentValues[extrafields[f]] = content;
								}
							}
						}
						if (fieldtype=="checkbox") {
							content = "";
							thisOne = 1;
							while (typeof result != "undefined") {
								if (result.checked == true) {
									if (content != "") {
										content = content+";";
									}
									content = content + result.value;
								}
								thisOne = thisOne + 1;
								eval("result = document.productForm"+productID+"."+extrafields[f]+thisOne+";");
							}
							currentValues[extrafields[f]] = content;
						}
						if (fieldtype=="radio") {
							eval("radlength = document.productForm"+productID+"."+extrafields[f]+".length;");
							for (g = 0; g < radlength; g++) {
								eval("thisoption = document.productForm"+productID+"."+extrafields[f]+"["+g+"].checked;");
								if (thisoption == true) {
									eval("thisvalue = document.productForm"+productID+"."+extrafields[f]+"["+g+"].value;");
										currentValues[extrafields[f]] = thisvalue;
								}
							}
						}
					}
				}
				eval ("arraylength = parray"+productID+".length;");
				eval ("advArray = parray"+productID+";");
				for (f = 0; f <  arraylength; f++) {		
					applicable = false;
					if (parseInt(advArray[f]["qtyfrom"]) != -1 && parseInt(advArray[f]["qtyto"]) != -1 && parseInt(advArray[f]["qtyto"]) != 0) {
						//quantity is applicable here
						if (parseInt(qty) >= parseInt(advArray[f]["qtyfrom"]) && parseInt(qty) <= parseInt(advArray[f]["qtyto"])) {
							applicable = true;
						}
					} else {
						applicable = true;
					}
					thisapplic = true;
					foundMatches = 0;
					for (g = 0; g < efcount; g++) {
						if (advArray[f][extrafields[g]] != "" && advArray[f][extrafields[g]] != "0") {
							splitCheck = advArray[f][extrafields[g]].split(";");
							splitapplic = false;
							for (k = 0; k < splitCheck.length; k++) {
								splitValues = currentValues[extrafields[g]].split(";");
							/////	alert("splitValues="+extrafields[g]);
								for (l = 0; l < splitValues.length; l++) {
									if ((splitCheck[k] == splitValues[l] && splitCheck[k] != "" && splitValues[l] != "")) {
										splitapplic = true;
										if (extrafieldstype[g] == "CHECKBOXES") {
											foundMatches = foundMatches + 1;
										}
									}
								}
							}
							if (splitapplic == true && thisapplic == true) {
								thisapplic = true;
							} else {
								thisapplic = false;
							}
						}
					}
					if (thisapplic == true && applicable == true) {
						applicable = true;
					} else {
						applicable = false;
					}
					if (applicable == true) {
						//new base price
						if (foundMatches == 0) { foundMatches =1; }
						if (parseInt(advArray[f]["priceType"]) == 0) {
							if (parseFloat(advArray[f]["percentage"]) > 0) {
								thisPrice = thisPrice + (thisPrice  * ((eval(advArray[f]["percentage"])/100)));
								thisPriceExTax = thisPriceExTax + (thisPriceExTax  * ((eval(advArray[f]["percentage"])/100)));
								thisPriceIncTax = thisPriceIncTax + (thisPriceIncTax  * ((eval(advArray[f]["percentage"])/100)));
								thisPriceTax = thisPriceTax + (thisPriceTax  * ((eval(advArray[f]["percentage"])/100)));
							}
							if (parseFloat(advArray[f]["percentage"]) < 0) {
								thisPrice = thisPrice - (thisPrice  * (Math.abs(eval(advArray[f]["percentage"]))/100));
								thisPriceExTax = thisPriceExTax + (thisPriceExTax  * (Math.abs(eval(advArray[f]["percentage"]))/100));
								thisPriceIncTax = thisPriceIncTax + (thisPriceIncTax  * (Math.abs(eval(advArray[f]["percentage"]))/100));
								thisPriceTax = thisPriceTax + (thisPriceTax  * (Math.abs(eval(advArray[f]["percentage"]))/100));
							}
							if (parseFloat(advArray[f]["percentage"]) == 0) {
								thisPrice = eval(advArray[f]["price"]);
								thisPriceExTax = eval(advArray[f]["priceExTax"]);
								thisPriceIncTax = eval(advArray[f]["priceIncTax"]);
								thisPriceTax = eval(advArray[f]["priceTax"]);
							}
						}
						if (parseInt(advArray[f]["priceType"]) == 1) {
							if (parseFloat(advArray[f]["percentage"]) > 0) {
								for (m = 1; m <= foundMatches; m++) {
									thisPrice = thisPrice + (thisPrice  * ((eval(advArray[f]["percentage"])/100)));
									thisPriceExTax = thisPriceExTax + (thisPriceExTax  * ((eval(advArray[f]["percentage"])/100)));
									thisPriceIncTax = thisPriceIncTax + (thisPriceIncTax  * ((eval(advArray[f]["percentage"])/100)));
									thisPriceTax = thisPriceTax + (thisPriceTax  * ((eval(advArray[f]["percentage"])/100)));
								}
							}
							if (parseFloat(advArray[f]["percentage"]) < 0) {
								for (m = 1; m <= foundMatches; m++) {
									thisPrice = thisPrice + (thisPrice  * (Math.abs(eval(advArray[f]["percentage"]))/100));
									thisPriceExTax = thisPriceExTax + (thisPriceExTax  * (Math.abs(eval(advArray[f]["percentage"]))/100));
									thisPriceIncTax = thisPriceIncTax + (thisPriceIncTax  * (Math.abs(eval(advArray[f]["percentage"]))/100));
									thisPriceTax = thisPriceTax + (thisPriceTax  * (Math.abs(eval(advArray[f]["percentage"]))/100));
								}
							}
							if (parseFloat(advArray[f]["percentage"]) == 0) {
								for (m = 1; m <= foundMatches; m++) {
									thisPrice = thisPrice + eval(advArray[f]["price"]);
									thisPriceExTax = thisPriceExTax + eval(advArray[f]["priceExTax"]);
									thisPriceIncTax = thisPriceIncTax + eval(advArray[f]["priceIncTax"]);
									thisPriceTax = thisPriceTax + eval(advArray[f]["priceTax"]);
								}
							}
						}	
						if (parseInt(advArray[f]["priceType"]) == 2) {
							if (parseFloat(advArray[f]["percentage"]) > 0) {
								for (m = 1; m <= foundMatches; m++) {
									thisPrice = thisPrice + (thisPrice * (eval(advArray[f]["percentage"])/100));
									thisPriceExTax = thisPriceExTax + (thisPriceExTax * (eval(advArray[f]["percentage"])/100));
									thisPriceIncTax = thisPriceIncTax + (thisPriceIncTax * (eval(advArray[f]["percentage"])/100));
									thisPriceTax = thisPriceTax + (thisPriceTax * (eval(advArray[f]["percentage"])/100));
								}
							}
							if (parseFloat(advArray[f]["percentage"]) < 0) {
								for (m = 1; m <= foundMatches; m++) {
									thisPrice = thisPrice + (thisPrice * (Math.abs(eval(advArray[f]["percentage"]))/100));
									thisPriceExTax = thisPriceExTax + (thisPriceExTax * (Math.abs(eval(advArray[f]["percentage"]))/100));
									thisPriceIncTax = thisPriceIncTax + (thisPriceIncTax * (Math.abs(eval(advArray[f]["percentage"]))/100));
									thisPriceTax = thisPriceTax + (thisPriceTax * (Math.abs(eval(advArray[f]["percentage"]))/100));
								}
							}
							if (parseFloat(advArray[f]["percentage"]) == 0) {
								for (m = 1; m <= foundMatches; m++) {
									thisPrice = thisPrice + eval(advArray[f]["price"]);
									thisPriceExTax = thisPriceExTax + eval(advArray[f]["priceExTax"]);
									thisPriceIncTax = thisPriceIncTax + eval(advArray[f]["priceIncTax"]);
									thisPriceTax = thisPriceTax + eval(advArray[f]["priceTax"]);
								}
							}
						}	
						if (parseInt(advArray[f]["priceType"]) == 4) {
							if (parseFloat(advArray[f]["percentage"]) > 0) {
								for (m = 1; m <= foundMatches; m++) {
									thisOOPrice = thisOOPrice + (thisOOPrice * (eval(advArray[f]["percentage"])/100));
									thisOOPriceExTax = thisOOPriceExTax + (thisOOPriceExTax * (eval(advArray[f]["percentage"])/100));
									thisOOPriceIncTax = thisOOPriceIncTax + (thisOOPriceIncTax * (eval(advArray[f]["percentage"])/100));
									thisOOPriceTax = thisOOPriceTax + (thisOOPriceTax * (eval(advArray[f]["percentage"])/100));
								}
							}
							if (parseFloat(advArray[f]["percentage"]) < 0) {
								for (m = 1; m <= foundMatches; m++) {
									thisOOPrice = thisOOPrice + (thisPrice * (Math.abs(eval(advArray[f]["percentage"]))/100));
									thisOOPriceExTax = thisOOPriceExTax + (thisOOPriceExTax * (Math.abs(eval(advArray[f]["percentage"]))/100));
									thisOOPriceIncTax = thisOOPriceIncTax + (thisOOPriceIncTax * (Math.abs(eval(advArray[f]["percentage"]))/100));
									thisOOPriceTax = thisOOPriceTax + (thisOOPriceTax * (Math.abs(eval(advArray[f]["percentage"]))/100));
								}
							}
							if (parseFloat(advArray[f]["percentage"]) == 0) {
								for (m = 1; m <= foundMatches; m++) {
									thisOOPrice = eval(advArray[f]["price"]);
									thisOOPriceExTax = eval(advArray[f]["priceExTax"]);
									thisOOPriceIncTax = eval(advArray[f]["priceIncTax"]);
									thisOOPriceTax = eval(advArray[f]["priceTax"]);
								}
							}
						}												
					}							
				}
				displayPrice = presentValue(thisPrice,cDP,cPreT,cMidT,cPostT);
				changeContent("priceSpan"+productID,"priceLayer"+productID,displayPrice);
				displayPrice = presentValue(thisPriceExTax,cDP,cPreT,cMidT,cPostT);
				changeContent("priceExTaxSpan"+productID,"priceExTaxLayer"+productID,displayPrice);
				displayPrice = presentValue(thisPriceIncTax,cDP,cPreT,cMidT,cPostT);
				changeContent("priceIncTaxSpan"+productID,"priceIncTaxLayer"+productID,displayPrice);
				displayPrice = presentValue(thisPriceTax,cDP,cPreT,cMidT,cPostT);
				changeContent("priceTaxSpan"+productID,"priceTaxLayer"+productID,displayPrice);
				
				displayPrice = presentValue(thisOOPrice,cDP,cPreT,cMidT,cPostT);
				changeContent("oopriceSpan"+productID,"oopriceLayer"+productID,displayPrice);
				displayPrice = presentValue(thisOOPriceExTax,cDP,cPreT,cMidT,cPostT);
				changeContent("oopriceExTaxSpan"+productID,"oopriceExTaxLayer"+productID,displayPrice);
				displayPrice = presentValue(thisOOPriceIncTax,cDP,cPreT,cMidT,cPostT);
				changeContent("oopriceIncTaxSpan"+productID,"oopriceIncTaxLayer"+productID,displayPrice);
				displayPrice = presentValue(thisOOPriceTax,cDP,cPreT,cMidT,cPostT);
				changeContent("oopriceTaxSpan"+productID,"oopriceTaxLayer"+productID,displayPrice);
			}
			
			isNS4 = (document.layers) ? true : false;
isIE4 = (document.all && !document.getElementById) ? true : false;
isIE5 = (document.all && document.getElementById) ? true : false;
isNS6 = (!document.all && document.getElementById) ? true : false;
			
function changeContent(theDiv,theLayer,newText) {
	if (isNS4){
	   elm = document.layers[theLayer];
	   elm.document.open();
       elm.document.write(newText);
       elm.document.close();

	}
	else if (isIE4) {
	   elm = document.all[theDiv];
	   elm.innerText = newText;
	}
	else if (isIE5) {
	   elm = document.getElementById(theDiv);
		if (elm) {
	   		elm.innerText = newText;
	   	}
	}
	else if (isNS6) {
		var elmw = document.getElementById(theDiv);
    	if (elmw) {
    		elmw.childNodes[0].nodeValue = newText;
    	}	
	}
}			

    function presentValue(value,dp,pt,mt,at) {
        if(value<=0.9999) {
            newPounds='0';
        } else {
            newPounds=parseInt(value);
        }
        dec='1';
        for (var i=1; i<=dp;i++) {
            dec=dec+'0';
        }
        if (value>0) {
            newPence=Math.round((eval(value)+.000008 - newPounds)*(eval(dec)));
        } else {
            newPence=0;
        }
        compstring='9';
        for (var i=1; i <=dp-1;i++) {
            if (eval(newPence) <= eval(compstring)) newPence='0'+newPence;
            compstring=compstring+'9';
        }
        if (dp>0) {
            if (newPence==eval(dec)) { newPounds++; newPence='00'; }
            newString=pt+newPounds+mt+newPence+at;
        } else {
            newString=pt+newPounds+at;
        }
        return (newString);
    }
    

    function pop_gallery(url) 
	{
	 var name='';
	 var args='WIDTH=630,HEIGHT=600,scrollbars=yes';
	 if (typeof(popupWin1) != "object")
	 {
	  popupWin1 = window.open(url, name, args);
	 } 
	 else 
	 {
	  if (!popupWin1.closed)
	  { 
	  popupWin1.location.href = url;
	  } 
	  else 
	  {
	  popupWin1 = window.open(url,  name, args);
	  }
	 }
	 popupWin1.focus();
	 
	}
	
	
	
isNS4 = (document.layers) ? true : false;
isIE4 = (document.all && !document.getElementById) ? true : false;
isIE5 = (document.all && document.getElementById) ? true : false;
isNS6 = (!document.all && document.getElementById) ? true : false; //FF

if (document.layers) { // Netscape
    document.captureEvents(Event.MOUSEMOVE);
    document.onmousemove = captureMousePosition;
} else if (document.all) { // Internet Explorer
    document.onmousemove = captureMousePosition;
} else if (document.getElementById) { // Netcsape 6
    document.onmousemove = captureMousePosition;
}

// Global variables
xMousePos = 0; // Horizontal position of the mouse on the screen
yMousePos = 0; // Vertical position of the mouse on the screen
xMousePosMax = 0; // Width of the page
yMousePosMax = 0; // Height of the page

function captureMousePosition(e) {
    if (document.layers) {
        // When the page scrolls in Netscape, the event's mouse position
        // reflects the absolute position on the screen. innerHight/Width
        // is the position from the top/left of the screen that the user is
        // looking at. pageX/YOffset is the amount that the user has
        // scrolled into the page. So the values will be in relation to
        // each other as the total offsets into the page, no matter if
        // the user has scrolled or not.
        xMousePos = e.pageX;
        yMousePos = e.pageY;
        xMousePosMax = window.innerWidth+window.pageXOffset;
        yMousePosMax = window.innerHeight+window.pageYOffset;
    } else if (document.all) {
        // When the page scrolls in IE, the event's mouse position
        // reflects the position from the top/left of the screen the
        // user is looking at. scrollLeft/Top is the amount the user
        // has scrolled into the page. clientWidth/Height is the height/
        // width of the current page the user is looking at. So, to be
        // consistent with Netscape (above), add the scroll offsets to
        // both so we end up with an absolute value on the page, no
        // matter if the user has scrolled or not.
        //xMousePos = window.event.x;//+document.body.scrollLeft;
        //yMousePos = window.event.y+document.body.scrollTop;
        
        
        if (document.documentElement && document.documentElement.scrollTop)
        {
        	xMousePos=window.event.x+document.documentElement.scrollLeft;
        	yMousePos=window.event.y+document.documentElement.scrollTop;
        	xMousePosMax = document.body.clientWidth+document.documentElement.scrollLeft;
        	yMousePosMax = document.body.clientHeight+document.documentElement.scrollTop;
        }
        else
        {
        	xMousePos=window.event.x+document.body.scrollLeft;
        	yMousePos=window.event.y+document.body.scrollTop;
        	xMousePosMax = document.body.clientWidth+document.body.scrollLeft;
       		yMousePosMax = document.body.clientHeight+document.body.scrollTop;
        }
            
     //   xMousePos = window.event.x+document.body.scrollLeft;
     //   yMousePos = window.event.y+document.body.scrollTop;
        
    } else if (document.getElementById) {
        // Netscape 6 behaves the same as Netscape 4 in this regard
        xMousePos = e.pageX;
        yMousePos = e.pageY;
        xMousePosMax = window.innerWidth+window.pageXOffset;
        yMousePosMax = window.innerHeight+window.pageYOffset;
    }
}

var old;
function sh_calc(id, obj)
{
	 //alert(xMousePos+" "+yMousePos+" "+xMousePosMax+" "+yMousePosMax);
	 if (document.getElementById) 
	 { 
	 	if(old)
		old.style.display = "none";
		var cos = document.getElementById(id);
		if(cos != old)
		{
			old = cos;
			
			cos.style.left = (xMousePos-190)+"px";
			cos.style.top = (yMousePos-61)+"px";
			cos.style.display = "";
		}
		else
			old = 0;
	 }
	 
	 
	 
	 if(document.layers) 
	 { 
	 	
	 	if(old)
		old.style.display = "none";
		var cos = document.layers[id];
		old = cos;
		cos.style.display = "";
	 	
	  	/*if (document.layers[ob].style.display=='none')
	    {  
	     document.layers[ob].style.display='';
	     //document.location=lx;
	    }
	   else
	    {
	     document.layers[ob].style.display='none';  
	    }*/
	 }
 
}


function getelement(id)
{
if (isNS4)
	{
		elm = document.layers[id];
	    //elm.document.open();
        //elm.document.write(totalprice);
        //elm.document.close();
        if (!elm)
			elm = false;
	}
	else 
		if (isIE4) 
		{
			elm = document.all[id];
			//elm.innerText = totalprice;
			if (!elm)
		        elm = false;
		}
		else 
			if (isIE5)
			{
				elm = document.getElementById(id);
				if (!elm)
		       		elm = false;
			}
			else 
				if (isNS6)
				{
					elm = document.getElementById(id);
					if (!elm)
		        		elm = false;
					
				}

	return elm;
}

function makeRequest_post2(url,load_handle_m,load_handle_info_m,params,contener)
{

    	load_handle = load_handle_m;
    	load_handle_info = load_handle_info_m;

        http_request = false;

        if (window.XMLHttpRequest) { // Mozilla, Safari,...
            http_request = new XMLHttpRequest();
            if (http_request.overrideMimeType) {
                http_request.overrideMimeType('text/xml');
                // See note below about this line
            }
        } else if (window.ActiveXObject) { // IE
            try {
                http_request = new ActiveXObject("Msxml2.XMLHTTP");
            } catch (e) {
                try {
                    http_request = new ActiveXObject("Microsoft.XMLHTTP");
                } catch (e) {}
            }
        }

        if (!http_request) {
            alert('Poddaje się :( Nie mogę stworzyć instancji obiektu XMLHTTP');
            return false;
        }
        //document.getElementById(load_handle_info).innerHTML = "Load";
        if(load_handle != null)
        	getelement(load_handle_info).innerHTML = "Load";
        /*http_request.onreadystatechange = alertContents;*/
        http_request.onreadystatechange = function() { alertContents(contener); };
        http_request.open('POST', url, true);
        http_request.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
        http_request.send(params);

}
name_function = "";
function alertContents(contener)
{
var regexp1 = /<script(.|\n)*?>(.|\n|\r\n)*?<\/script>/ig;
var regexp2 = /<script(.|\n)*?>((.|\n|\r\n)*)?<\/script>/im;
        			
	if (http_request.readyState == 4) {
    	if (http_request.status == 200) {
                //alert(http_request.responseText);
               // alert("start?");
                
                getelement('add_to_bassket2').style.display = "none";
				getelement('add_to_bassket1').style.display = "";
	
               	//document.getElementById(load_handle_info).innerHTML ="";
                //document.getElementById(load_handle).innerHTML = "";
                //document.getElementById(load_handle).innerHTML = http_request.responseText;
                if(load_handle_info != null)
                	getelement(load_handle_info).innerHTML ="";
                if(load_handle != null)
                {
	                //getelement(load_handle).innerHTML = "";
	                //alert(http_request.responseText);
	                getelement(load_handle).innerHTML = http_request.responseText;
	                
		        	/* draw the html first */
		        	if(contener != null)
		        	{
		        	
			        	viewData = http_request.responseText;
			        	partId = 1;
	        			htmlpart = viewData.replace(regexp1, "");
		        		var result = viewData.match(regexp1);
		        		if (result)
		        		{
		            		for (var i = 0; i < result.length; i++)
		            		{
		                		var realScript = result[i].match(regexp2);
		                		executeScript(realScript[2], partId, contener);
			               /* break;  process only one script element */
		            		}
		        		} 
	            	}
					if(name_function != "")
					{
	                	setTimeout(name_function,2);
	                	text_html = http_request.responseText
					}
                }
                
                
            } else {
                alert('Wystąpił problem z zapytaniem.');
            }
        }
        else
        {
        	/*switch(http_request.readyState)
        	{
        		case 0: wartosc = "niezainicjowane";
        			break;
        		case 1: wartosc = "w trakcie pobierania";
        			break;
        		case 2: wartosc = "pobrano";
        			break;
        		case 3: wartosc = "interaktywne";
        			break;
        	}*/
        	//document.getElementById(load_handle_info).innerHTML +=".";
        	if(load_handle_info != null)
        	{
        		getelement(load_handle_info).innerHTML +=".";
	        	if(getelement(load_handle_info).innerHTML.length > 16)
	        		getelement(load_handle_info).innerHTML = "Load";
        	}
	        //document.getElementById('desctop').innerHTML += wartosc+"\r\n";
        	//setTimeout("f2()",10000);
        }
}

function executeScript(scriptFrag, partId, contener)
{
	var scriptContainerId = partId + "_SCRIPT_CONTAINER";
	var obj = scriptContainerId;
	var ss = document.getElementsByTagName("SCRIPT");
	if (obj != null) {
		//document.body.removeChild(obj);
	}
	//var scriptContainer = document.createElement('SCRIPT');
	var scriptContainer = document.createElement('SCRIPT');
	scriptContainer.setAttribute("id", scriptContainerId);
	scriptContainer.text = scriptFrag;
	//document.body.appendChild(scriptContainer);
	getelement(contener).appendChild(scriptContainer);
}



function sdiv(obj,action)
	{
		var children = obj.childNodes;
		if(action)
		{
			obj.style.backgroundColor = "#3668AB";
			children[0].style.color = "#FFFFFF";
			SIA(0);
		}
		else
		{
			obj.style.backgroundColor = "#FFFFFF";
			children[0].style.color = "#3668AB";
			SIA(1);
		}
	}
	var czas_x;
	var obj_x;
	function show_mm(id,obj,xo)
	{
		var obj_h = getelement(id);
		if(obj_h)
		{
				if(xo)
				{
					clearInterval(czas_x);
					if(obj_x && obj_x != obj_h)
					{
						obj_x.style.display = "none";
					}
					obj_h.style.left = (moveXbySlicePos2(0,obj))+"px";//"100px";
					obj_h.style.top = (moveYbySlicePos2(0,obj))+18+"px";//"100px";
					obj_h.style.display = "";
				}
				else
				{
					obj_x = obj_h;
					czas_x = window.setInterval(cheack_sys,2000, true);//setInterval
				}
		}
	}
	
	function cheack_sys()
	{
		obj_x.style.display = "none";
		clearInterval(czas_x);
	}
	
	function SIA(nr)
	{
		clearInterval(czas_x);
		if(nr)
		{
			czas_x = window.setTimeout(cheack_sys,2000, true);//setInterval
		}
	}
	
	function moveXbySlicePos2 (x, img) { 
		if (!document.layers) {
			var onWindows = navigator.platform ? navigator.platform == "Win32" : false;
			var macIE45 = document.all && !onWindows && getExplorerVersion() == 4.5;
			var par = img;
			var lastOffset = 0;
			while(par){
				if( par.leftMargin && ! onWindows ) x += parseInt(par.leftMargin);
				if( (par.offsetLeft != lastOffset) && par.offsetLeft ) x += parseInt(par.offsetLeft);
				if( par.offsetLeft != 0 ) lastOffset = par.offsetLeft;
				par = macIE45 ? par.parentElement : par.offsetParent;
			}
		} else if (img.x) { x += img.x; alert(x);}
		return x;
	}
	
	function moveYbySlicePos2 (y, img) {
		if(!document.layers) {
			var onWindows = navigator.platform ? navigator.platform == "Win32" : false;
			var macIE45 = document.all && !onWindows && getExplorerVersion() == 4.5;
			var par = img;
			var lastOffset = 0;
			while(par){
				if( par.topMargin && !onWindows ) y += parseInt(par.topMargin);
				if( (par.offsetTop != lastOffset) && par.offsetTop ) y += parseInt(par.offsetTop);
				if( par.offsetTop != 0 ) lastOffset = par.offsetTop;
				par = macIE45 ? par.parentElement : par.offsetParent;
			}		
		} else if (img.y >= 0) y += img.y;
		return y;
	}
	
function select_sec(obj,nr)
{
	if(nr == 1)
	{
		obj.style.border = "1px solid #0099CC";
	}
	else
	{
		obj.style.border = "1px solid #cccccc";
	}
}

function start_link(url)
{
	stop(interv);
	window.location.href = url;
}

var c=0;
function show_text()
{
	if(c == 0)
	{
		//alert(getelement("textintropr").childNodes[0].tagName);
		if(getelement("textintropr").childNodes[0].tagName != "TABLE")
			getelement("w4fmarketing").appendChild(getelement("textintropr").childNodes[1]);
		else
			getelement("w4fmarketing").appendChild(getelement("textintropr").childNodes[0]);
		c++;
	}
}


	if(typeof window.addEventListener != "undefined")
		window.addEventListener("load", myinit, false );
	else
		if(typeof window.attachEvent != "undefined" )
			window.attachEvent( "onload", myinit);
		

	function myinit()
	{
		var x1 = document.getElementById("art2A");
		var x2 = document.getElementById("textintrosec");
		if(x2)
		{
			var x3 = moveYbySlicePos2(0,x1)+x1.clientHeight;
			x2.style.marginTop = x3+"px";
			x2.style.marginLeft = moveXbySlicePos2(0,x1)+"px";
			x1.style.paddingBottom = x2.clientHeight+"px";
		}
		
		x1 = document.getElementById("menu_l");
		x2 = document.getElementById("left_men");
		if(x2)
		{
			x1.style.height = x2.clientHeight+"px";
			x2.style.marginLeft = "0px";
			x2.style.left = (moveXbySlicePos2(0,x1)+1)+"px";
		}
		else
		{
			x2 = document.getElementById("left_men3");
			if(!x2)
				x2 = document.getElementById("left_men4");
			if(x2)
			{
				x1.style.height = x2.clientHeight+"px";
				x2.style.marginLeft = "0px";
				x2.style.left = (moveXbySlicePos2(0,x1)+1)+"px";
			}
		}
	}
	
var interv = 0;
	function stop(arr)
	{
		if(arr)
			clearInterval(arr);
	}
function val_search()
{
 if (document.searchForm.xSearch.value!="") return true;
 else {alert('Please input a keyword to search.'); return false;}
}

function reloadOption(obj){
	stop(interv);
 document.location.href = obj.value;
}