function chatpopup(lang) {
    window.open("https://chat.casinodesk.com/webchat/chatform" + lang + ".asp", "Chat", "width=400, height=410, border=2, scrollbars=no, resizable=no");
}
function popup(mylink, windowname)
{
if (! window.focus)return true;
var href;
if (typeof(mylink) == 'string')
   href=mylink;
else
   href=mylink.href;
window.open(href, windowname, 'width=600,height=700,scrollbars=yes');
return false;
}

function previewpopup(lang) {
    window.open("http://www.vegaspalms.eu/preview/" + lang + ".asp", "Chat", "width=600, height=500, border=2, scrollbars=no, resizable=no");
}
function popup(mylink, windowname)
{
if (! window.focus)return true;
var href;
if (typeof(mylink) == 'string')
   href=mylink;
else
   href=mylink.href;
window.open(href, windowname, 'width=600,height=700,scrollbars=yes');
return false;
}


function selfassess() 
{

    window.open("http://www.vegaspalms.eu/eu/selfassessment/", "SelfAssess", "width=500,height=550, scrollbars=yes, resizable=no");  
 
}

function Get_Cookie( check_name ) {
	var a_all_cookies = document.cookie.split( ';' );
	var a_temp_cookie = '';
	var cookie_name = '';
	var cookie_value = '';
	var b_cookie_found = false; // set boolean t/f default f

	for ( i = 0; i < a_all_cookies.length; i++ )
	{
		a_temp_cookie = a_all_cookies[i].split( '=' );


		cookie_name = a_temp_cookie[0].replace(/^\s+|\s+$/g, '');

		if ( cookie_name == check_name )
		{
			b_cookie_found = true;
			// we need to handle case where cookie has no value but exists (no = sign, that is):
			if ( a_temp_cookie.length > 1 )
			{
				cookie_value = unescape( a_temp_cookie[1].replace(/^\s+|\s+$/g, '') );
			}
			// note that in cases where cookie is initialized but no value, null is returned
			return cookie_value;
			break;
		}
		a_temp_cookie = null;
		cookie_name = '';
	}
	if ( !b_cookie_found )
	{
		return null;
	}
}


function Set_Cookie( name, value, expires, path, domain, secure )
{
var today = new Date();
today.setTime( today.getTime() );

if ( expires )
{
expires = expires * 1000 * 60 * 60 * 24;
}
var expires_date = new Date( today.getTime() + (expires) );

document.cookie = name + "=" +escape( value ) +
( ( expires ) ? ";expires=" + expires_date.toGMTString() : "" ) +
( ( path ) ? ";path=" + path : "" ) +
( ( domain ) ? ";domain=" + domain : "" ) +
( ( secure ) ? ";secure" : "" );
}


function doTrack(action) {
s.linkTrackVars='eVar3,events';

switch(action) {
	case 'Download':
		_gaq.push(['_trackEvent', 'Conversion', 'Download']);
		s.linkTrackEvents='event7';
		s.eVar3=s.pageName;
		s.events='event7';
		s.tl(this,'d','Download Casino');
		break;
	case 'Flash':
		_gaq.push(['_trackEvent', 'Conversion', 'Flash']);
		s.linkTrackEvents='event8';
		s.eVar3=s.pageName;
		s.events='event8';
		s.tl(this,'o','Instant Play');
		break;
}
}

function MM_showHideLayers() { //v9.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) 
  with (document) if (getElementById && ((obj=getElementById(args[i]))!=null)) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'block':(v=='hide')?'none':v; }
    obj.display=v; }
    }
	function openSupportPopup(mailtype) {
    window.open("/ContactForm/?MailType=" + mailtype, "Email_Vegas_Towers", "width=360,height=600,directories=no,toolbar=no,resizable=yes,location=no,menubar=no,status=no,scrollbars=no");
    return false;
}

function checkSEO(tag) {
	try 
		{
			tag = tag.toUpperCase();
			tag = tag.substring(0,3)
			if(tag=="SE-") {
				//alert("in");
				$(".ContentHomeMoreInfo").html('<a href="#" class="displayOffer"><span id="searchOffer"></span></a><div style="" id="searchOfferCopy"></div>');
				$("head").append('<script src="/scripts/jquery.colorbox-min.js"></script><link media="screen" rel="stylesheet" href="/stylesheets/colorbox.css" />');
				$(".ContentHomeInstantPlay").html('');
				$(document).ready(function(){
					$('.displayOffer').colorbox({width:"600px", height:"480px", inline:true, href:"#searchOfferCopy", transition: "elastic"});
					$('.displayOffer').bind('cbox_load', function () {
						$('#searchOfferCopy').html('<h1 align="center">Join today and get 60 free spins EXTRA!</h1><p><strong>You Googled us</strong> (or found us through another search engine) so we’re welcoming you to the casino with a <strong>EXTRA bonus</strong>.</p><h2>Here’s how it works:</h2><table cellspacing="0" cellpadding="2" align="center" width="500" border="1"><tr align="center"><td rowspan="2">Make your <strong>FIRST deposit</strong></td><td><strong>200% match bonus</strong> up to 100 credits extra</td></tr><tr align="center"><td>PLUS you get <strong>20 FREE SPINS</strong> on the Tomb Raider Slot</td></tr><tr align="center"><td>Make your <strong>SECOND deposit</strong></td><td>Get <strong>20 FREE SPINS</strong> on the Tomb Raider Slot</td></tr><tr align="center"><td>Make your <strong>THIRD deposit</strong></td><td>Get <strong>20 FREE SPINS</strong> on the Tomb Raider Slot</td></tr></table><p style="font-size:16px;font-weight:bold;">That’s a total of 60 FREE SPINS!</p><p>You will get your free spins <strong>automatically</strong> once you have made your deposits.</p><div id="searchButtonBox"><a href="/download.casino" onclick="doTrack(&quot;Download&quot;)"><span id="searchDownload"></span></a><span id="midText">OR</span><a href="/flash.casino" target="_blank" onclick="doTrack(&quot;Flash&quot;)"><span id="searchFlash"></span></a></div><p align="center" style="clear: both;">Please view the <a href="/promotions/promotion-terms-conditions/">casino promotion terms and conditions</a> that apply.</p>');
					});
					$('.displayOffer').bind('cbox_closed', function () {
						$('#searchOfferCopy').html('');
					});
				});
				//alert("out");
			}
		}
	catch(err)
		{
			document.write("<!-- An error occured: "+err+" -->");
		}
}
