﻿function fav() {
	if (document.all)
		window.external.AddFavorite('http://www.find-game.co.uk/', 'UK Cheap PC and Video Games');
	else
		alert("Sorry. Netscape users must bookmark the pages manually by hitting <Ctrl-D>");
}

function eMail() {
	window.location = "mailto:info@find-games.co.uk"
}

function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=400,height=345');");
}


function autofitIframe(lWidth, lHeight){
 if (!window.opera && !document.mimeType && document.all && document.getElementById){
  document.getElementById('player').style.width = lWidth+"px"; 
  document.getElementById('player').style.height = lHeight+"px"; 
 } 
 else if(document.getElementById) { 
  document.getElementById('player').style.width = "400px"; 
  document.getElementById('player').style.height = "345px"; 
 }  
}



function embedTrailer(url)
{
    var flashvars = {};
    var params = {};
    params.bgcolor = "#000000";
    params.allowfullscreen = "true";
    params.allowscriptaccess = "always";
    var attributes = {};
    attributes.id = "player";
    swfobject.embedSWF("/player/g2c_player.swf?" + url, "trailer", "640", "525", "9.0.0", "/player/expressInstall.swf", flashvars, params, attributes);
}


function processResponse(_form, data)
	{
	    var message = $(data).find('message').text();
	    var tips = $(_form).find('.validateTips');
	    
	    tips.text(message).addClass('ui-state-highlight');
	    setTimeout(function() { tips.removeClass('ui-state-highlight', 1500); }, 1500);

	    $(data).find('errorField').each(function()
	    {
            $(_form).find(':[name=' +  $(this).text() +  ']').addClass('ui-state-error');
        });
	}
