/* SITEINFO:START */
var SITE_ID = 1761;
var SITE_NAME = "supermarket.co.uk";
var SITE_URL = "http://www.supermarket.co.uk";
/* SITEINFO:END */

if (window.location.toString().substr(0,5)!="http:") {window.location = "http://192.168.69.95"+ window.location.toString().split(/Inetpub\/wwwroot/i)[1];}



/* ASYNC:START */
/*
	multiple 'Async' loader - flexible and quick approach to bring in

*/

var asyncloaders = new Array();
function loadAsyncHTML(n,p,f) {
	document.write("<div id='linksin'><h4>Supermarket deals</h4><div id='googleadense'>");

	document.write("<script type='text\/javascript'> google_ad_client = \"pub-0889711162937032\"; google_ad_slot = \"5036708070\"; google_ad_width = 468; google_ad_height = 60;  <\/script> ");
	document.write(" <script type='text\/javascript'  src='http://pagead2.googlesyndication.com/pagead/show_ads.js'><\/script> ");
	document.write(" <\/div><\/div> ");

}

function writeLayer(n,h) {
	var d=document;
	if (d.all) {
		d.all[n].innerHTML=h;
	} else {
		if (d.getElementById) {
			o=d.getElementById([n]);
			r=d.createRange();
			r.setStartBefore(o);
			while (o.hasChildNodes()) {o.removeChild(o.lastChild);	}
			o.appendChild(r.createContextualFragment(h));
	   }
	}
}

function splitToLayers(h,n,d) {
	for (var i=0; i<n.split(",").length;i++) {writeLayer(n.split(",")[i],h.split(d)[i]);}
}
/* ASYNC:END */

function pop(app){
	window.open(app,"test","resizable=yes,scrollbars=yes,width=800,height=600,screenX=100,screenY=100,top=5,left=60");
}

function addbookmark(){
if (document.all)
	window.external.AddFavorite(SITE_URL, SITE_NAME);
}

function jumpproduct(menuObj, myUrl) {
	var sel = menuObj.selectedIndex;
	if (sel<=0) return;
	var u = myUrl+menuObj.options[sel].value;
	menuObj.form.submit();
}

function checkPoll(f) {
	for(var i=0; i!=f.pollVote.length; i++) {
		if (f.pollVote[i].checked) return true;
	}
	alert("Please choose an option");
	return false;
}



// contact page JS for contact/advertising pages.

var newwindow;

function contact(){
	newwindow=window.open("contact/contact.asp",'name','height=320,width=400');
	
}
function contactL(){ //list in directory
	newwindow=window.open("contact/contact.asp?t=1",'name','height=320,width=400');
	
}
function contactP(){ //problem
	newwindow=window.open("contact/contact.asp?t=2",'name','height=320,width=400');
	
}
function contactL(){ //listing
	newwindow=window.open("contact/contact.asp?t=3",'name','height=320,width=400');
	
}
function contactS(){ //voucher
	newwindow=window.open("contact/contact.asp?t=4",'name','height=320,width=400');
	
}
function contactSX(){ //voucher
	newwindow=window.open("../contact/contact.asp?t=4",'name','height=320,width=400');
	
}
function contactA(){ //advertising
	newwindow=window.open("contact/contact.asp?t=5",'name','height=320,width=400');
	
}
function contactM(){ //media
	newwindow=window.open("contact/contact.asp?t=6",'name','height=320,width=400');
	
}

 function GetQuery(name) {
        var match = new RegExp(name + "=(.+)[&]", "i").exec(location.search);
        if (match == null) {
            match = new RegExp(name + "=(.+)", "i").exec(location.search);
        }

        if (match == null) {
            return null;
        }

        match = match + "";
        result = match.split(",");
		searchterm = result[1].replace( new RegExp( "%2B", "g" ), "+" );
		document.getElementById(name).value = searchterm;
        return result[1];
    }

	function google_afs_request_done(google_ads)
      {
		  var google_num_ads = google_ads.length;
          if (google_num_ads <= 0)
          {
              return;
          }

          var Ads = ""; 

          for(i = 0; i < google_num_ads; i++)
          {
              if (google_ads[i].type=="text/wide")
              {
                  // render a wide ad
                  Ads += '<div class="ad_item"><a class="ad_line1" onmouseover="javascript:window.status=\'' +
                          google_ads[i].url + '\';return true;" ' +
                          'onmouseout="javascript:window.status=\'\';return true;" ' +
                          'href="' + google_ads[i].url + '">' + google_ads[i].line1 + '</a><br>' +
                          
                          '<span class="ad_text">' + google_ads[i].line2 + '</span><br>' +
                          
                          '<a class="ad_url" onmouseover="javascript:window.status=\'' +
                          google_ads[i].url + '\';return true;" ' +
                          'onmouseout="javascript:window.status=\'\';return true;" ' +
                          'href="' + google_ads[i].url + '">' + google_ads[i].visible_url + '</a></div>';
              }
          }

          // Write HTML for wide and narrow ads to the proper <div> elements
          document.getElementById("bmm_google").innerHTML = Ads;
      }

		  
	  
	  google_afs_client = 'pub-2925343368625090'; // substitute your client ID
      google_afs_channel = '3254803695'; // enter your custom channel ID
	  
      google_afs_query = "free stuff" //GetQuery('qa');//"ipod";
      google_afs_ad = 'w10'; // number of ads
      google_afs_ie = 'utf-8';
      google_afs_oe = 'utf-8';
      google_afs_adsafe = 'low';
      google_afs_hl = 'en';
      google_afs_adpage='1';
    