    var swfId = "website";

    function openWindow(pageUrl) 
    {
        var winName = Math.round(9999*Math.random()) + new Date().getTime();
        var winNew = window.open(pageUrl,winName,"toolbar=1,scrollbars=1,location=1,statusbar=0,menubar=0,resizable=1,width=800,height=700,left=200,top=100");

        if(!winNew) {
            getSwf(swfId).openWindowFromSwf(pageUrl);
        }
        else {
            winNew.focus();
        }
    }

    function openWin(pageUrl, winName, features) 
    {
        var popup = window.open(pageUrl,winName,features);

        if(!popup) 
        {
            getSwf(swfId).openWindowWithName(pageUrl, winName);
        }
        else if ( window.opera)
        {
        	if (!popup.opera)
        	{	
	            getSwf(swfId).openWindowWithName(pageUrl, winName);
        	}
        } 
        else 
        {
            popup.focus();
        }
    }


    function getSwf(id) {
        if (navigator.appName.indexOf("Microsoft") != -1) {
            return window[id];
        } 
        else {
            return document[id];
        }
    }    
		
  productframeSrc = "php/product_banner.php";
  productcounterframeSrc = sponsorBase;
	productframeIsVisible = true;

	function updateProductBanner(height, ctxt, mode, selection, products, language, cid, url) 
	{
		adframe = document.getElementById('productad_iframe');
		if (adframe) 
		{
			if (url)
			{
				adframe.src = url;
			}
			else
			{
				pageSrc = productframeSrc;
        pageSrc = pageSrc + "?height=" + height;
				if (ctxt != null)
					pageSrc = pageSrc + "&ctxt=" + ctxt;
				if (language != null)
					pageSrc  = pageSrc + "&language=" + language;
				pageSrc  = pageSrc + "&mode=" + mode;
				pageSrc  = pageSrc + "&selection=" + selection;
				pageSrc  = pageSrc + "&products=" + products;
				adframe.src = pageSrc;
			}
		}
    
		counterframe = document.getElementById('productad_counter_iframe');
		if (counterframe) 
		{
      pageSrc = productcounterframeSrc;
      pageSrc = pageSrc + "?height=" + height;
      if (ctxt != null)
        pageSrc = pageSrc + "&ctxt=" + ctxt;
      if (language != null)
        pageSrc = pageSrc + "&language=" + language;
      pageSrc = pageSrc + "&mode=" + mode;
      pageSrc = pageSrc + "&selection=" + selection;
      pageSrc = pageSrc + "&products=" + products;
      pageSrc = pageSrc + "&cid=" + cid;
      counterframe.src = pageSrc;
		}
	}
	
  window.onbeforeunload = function()
   { 
		canU = getSwf(swfId).canUserLeavePage();
		
			return canU;
//     return 'Please do not leave this page.'; 
   }

