<!--
//Key stroke delay for search in ms
var keyDelay = 200;
var executing = false;

function createRequestObject() {
    var ro;
    var browser = navigator.appName;
    if(browser == "Microsoft Internet Explorer"){
        ro = new ActiveXObject("Microsoft.XMLHTTP");
    }else{
        ro = new XMLHttpRequest();
    }
    return ro;
}
var http = createRequestObject();
function sndReq(action) {
    http.open('get', action);
   http.onreadystatechange = handleResponse;
    http.send(null);
}
function handleResponse() {
    if(http.readyState == 4){
		document.getElementById('searchResultsDiv').innerHTML = http.responseText;
    }
}

function doSearch(whichBox,offset,clastupdate) {
	if(executing == false){
	executing = true;
	setTimeout(function(){execSearch(whichBox,offset,clastupdate)},keyDelay);
	}
}

function findPosX(obj){
  var curleft = 0;
  if(obj.offsetParent)
      while(1) 
      {
        curleft += obj.offsetLeft;
        if(!obj.offsetParent)
          break;
        obj = obj.offsetParent;
      }
  else if(obj.x)
        curleft += obj.x;
  return curleft;
}

function findPosY(obj){
  var curtop = 0;
  if(obj.offsetParent)
      while(1)
      {
        curtop += obj.offsetTop;
        if(!obj.offsetParent)
          break;
        obj = obj.offsetParent;
      }
  else if(obj.y)
      curtop += obj.y;
  return curtop;
 }


function execSearch(whichBox,offset,clastupdate) {
			
	if (clastupdate.length > 2) {
		var dStamp = clastupdate;
	}
	else  {
		Stamp = new Date();
		var dStamp = Stamp.getYear() + '' + Stamp.getMonth() + '' + Stamp.getDate() + '' + Stamp.getHours() + '' + Stamp.getMinutes() + '' + Stamp.getSeconds() ;
	}
	if (whichBox==1) {
		document.getElementById('searchResultsDiv').style.top = '75px';
		document.getElementById('searchResultsDiv').style.left = findPosX(document.getElementById('keyword1')) + 'px';
		var val = '/search/searchresults.asp?q=' + document.getElementById('keyword1').value + '&plat=' + document.getElementById('platform1').value + '&ds=' + dStamp ; 
	    var len =  document.getElementById('keyword1').value.length;
	}
	else {
		document.getElementById('searchResultsDiv').style.top = findPosY(document.getElementById('keyword2')) + 'px';
		document.getElementById('searchResultsDiv').style.left = findPosX(document.getElementById('keyword2')) + 175 + 'px';
		var val = '/search/searchresults.asp?q=' + document.getElementById('keyword2').value + '&plat=' + document.getElementById('platform2').value + '&ds=' + dStamp ; 	
	    var len =  document.getElementById('keyword2').value.length;
	}
	if (len > 2 ||len ==0)
	    {
	    sndReq(val);
	    }
	    executing = false;
	    return false;
}


// Tool Tip Code

var tt_boxobj;

function tt_init() {
	if(document.all){
		tt_boxobj = document.all.tt_outer;
	}
	else{
		tt_boxobj = document.getElementById('tt_outer')
	}
}

function tt_mover(e)
{
	var xCoord;
	var yCoord;
	try{
	if(document.all) {
		
		xCoord = window.event.clientX;
		yCoord = window.event.clientY;
		box_height = tt_boxobj.offsetHeight;
		screen_height = document.body.clientHeight;
		box_width = tt_boxobj.offsetWidth;
		screen_width = document.body.clientWidth;
		
	}
	else {
		xCoord = e.clientX;
		yCoord = e.clientY;
		box_height = tt_boxobj.offsetHeight;
		screen_height = document.body.clientHeight;
		box_width = tt_boxobj.offsetWidth;
		screen_width = document.body.clientWidth;
	}

	if (screen_height - box_height - 10 < yCoord)
		yCoord -= box_height;

	if (screen_width - box_width - 20 < xCoord)
		xCoord -= box_width + 25;

	tt_boxobj.style.left = xCoord + document.body.scrollLeft + 15 + 'px';
	tt_boxobj.style.top = yCoord + document.body.scrollTop + 10 + 'px';
	}
	catch(err){}

}

function tt_fade () {
	
	tt_boxobj.filters.alpha.opacity += 5;
	if(tt_boxobj.filters.alpha.opacity >= 90)
		tt_boxobj.filters.alpha.opacity = 90;
	else
		setTimeout("tt_fade()", 15);
}

function tooltip_on(title_text, body_text)
{
	canCloseList = 0;
	if(document.all) {
		document.all.tt_body.innerHTML = body_text;
		tt_boxobj.style.display = 'inline';
		tt_fade();
		tt_mover();
	}
	else {
		document.getElementById('tt_body').innerHTML = body_text;
		tt_boxobj.style.display = 'inline';
	}
}

function tooltip_off(){
	canCloseList = 1;
	if(document.all)
	{
		tt_boxobj.filters.alpha.opacity = 0;
	}
	tt_boxobj.style.display = 'none';
}

function noimage(source,plat,server){
	server = server.replace('|','')
	source.src = 'http://' + server +  '/images/noboxshots/noboxshot_m' + plat + '.jpg';
}

function delayClear(delay){
	if (canCloseList == 1)
		{
		var t=  setTimeout("clearo(document.getElementById('searchResultsDiv'))",delay);
		}
}

function clearo(object2){
	tooltip_off() ;
	object2.innerHTML = '';	
}

function refocus(){
	document.getElementById('keyword2').focus() 
}

function dispPD(server,productCode,title,platform,platformText,price,streetPrice,saving){
	var productDetails = '<table width=100% cellspacing=3 cellpadding=0 class=vsmblack border=0><tr><td><img width=50 src=http://' + server + '/images/Products/'+ productCode +'_mbox.jpg onerror=noimage(this,%27'+ platform +'%27,%27|' + server  + '%27) class=picframe title='+ title +'></td><td align=left><span class=vsmblack><b>'+ title + '</b></span><div class=platformText>' + platformText + '</div><div class=price ><b>Gameplay Price &pound;' + price + '</b></div><div class=ssp>SSP Price &pound;' + streetPrice + '<span class=saving>&nbsp;Save &pound;'+ saving +'!</span></div></td></tr></table>';
	tooltip_on('',unescape(productDetails));
}

function reloc(server, productCode){
	window.location.href = 'http://' + server + '/webstore/add_to_basket.asp?productcode=' + productCode;
}

function relocPP(server, productCode,title,platform,platformText){

	var titleTextFormated = title.replace('(','').replace(')','').replace(':','').replace('?','').replace('&',' ').replace('-',' ').replace('#','').replace('%','').replace(/^\s+|\s+$/g,'').replace(/\s+/g,' ').replace(/\s/g,'-');
	var platformTextFormated = platformText.replace(/\s/g,'-');
	window.location.href = 'http://' + server + '/' + platformTextFormated + '/' + titleTextFormated + '/_/' + productCode + '/productpage.html';
}


document.onmousemove = tt_mover;




if(document.captureEvents) {document.captureEvents(Event.MOUSEMOVE);}
var canCloseList = 1;

//-->
