function Show_Hide_Div(id){
  
  if(document.getElementById(id)){
    
     if(document.getElementById(id).style.display == '' || document.getElementById(id).style.display == 'block')
        document.getElementById(id).style.display = 'none';
     else
        document.getElementById(id).style.display = 'block';
  }
}
 function OnMouseOver(image, popup){
   var pos_offset = $("#pict_container").offset();
   var add_offset = 16;
   var pos = $('#'+image).offset();
   var x = pos.left - pos_offset.left + add_offset;
   var y = pos.top + add_offset;
   $('#'+popup).css({'left': (x+70) + "px",  'top': (y+40) + "px"});
   $('#'+popup).show();
}
function OnMouseOut(image, popup){
$('#'+popup).hide();
}
function ValidateForm (theform){
  if(theform.realAcc.value == "") {
    alert(Drupal.t('Invalid Account Number. Please check and try again.'));
    theform.elements.item("realAcc", 0).focus();
    return false;
  }
  return true;
}
function open_christmas_promo()
{
	window.open('christmas_spin.html', 'christmas_spin_window', 'width=901,height=601,resizable=no,scrollbars=0,top=0,left=0');
}


function newlivedealer(LoginName, LoginPassword, CasinoID, url){
    my_window = window.open("", "mywindow1", "status=1,width=1015,height=650");
    my_window.document.write("<center><b>Loading...</b></center><form id='newlivedealer1' name='newlivedealer1' action='"+url+"' method='POST'><input name='LoginName' type='hidden' value='" + LoginName + "'/><input name='Password' type='hidden' value='" + LoginPassword + "'/><input name='ClientType' type='hidden' value='1'/><input name='ModuleID' type='hidden' value='70004'/><input name='CasinoID' type='hidden' value='" + CasinoID + "'/> <input name='BetProfileID' type='hidden' value='0'/><input name='VideoQuality' type='hidden' value='2'/><input name='ClientID' type='hidden' value='2'/><input name='UL' type='hidden' value='en' /><input name='UserType' type='hidden' value='0' /><input name='ProductID' type='hidden' value='2' /><input type='hidden' name='ActiveCurrency' value='Credits' /><input type='submit' value='GO' style='display:none;' /></form>");
    setTimeout("my_window.document.getElementById('newlivedealer1').submit()", 100);
}
function OpenCloseDiv(id){

  if(document.getElementById(id).style.display == 'block'){
    document.getElementById(id).style.display = 'none';
    document.getElementById('lang_close').style.display = 'none';
    document.getElementById('lang_open').style.display = 'block';
  }else{
    document.getElementById(id).style.display = 'block';
    document.getElementById('lang_close').style.display = 'block';
    document.getElementById('lang_open').style.display = 'none';
  }
}


function ValidateFormClaimBonus (theform,code){
    
  if(theform.realAcc.value == "") {
  	alert(Drupal.t('Invalid Account Number. Please check and try again.'));
    theform.elements.item("realAcc", 0).focus();
    return false;
  }
  
	  if(theform.code.value == "") {
	    alert(Drupal.t('Invalid Code Number. Please check and try again.'));
    theform.elements.item("code", 0).focus();
    return false;
  	
   }
   if(theform.code.value.toLowerCase() != code) {
	    alert(Drupal.t('Invalid Code Number. Please check and try again.'));
    theform.elements.item("code", 0).focus();
    return false;
	  }

  return true;
 }

function lngMenu(obj)
{
	$(obj).toggleClass('btn_x_lng_blue');
	$(".lng_options").toggle();
}

function ValidateTwitterForm(obj){
	if(document.getElementById('edit-account').value == ''){
		alert(Drupal.t('Please enter your Account Number'));
		document.getElementById('edit-account').focus();
		return false;
	}
	var regex = /[a-zA-Z0-9]$/;
	if(!regex.test(document.getElementById('edit-account').value) ){
		alert(Drupal.t('The Account Number you entered contains illegal characters. Please use alphanumeric characters only. (No spaces or symbols.)'));
		document.getElementById('edit-account').focus();
		return false;
	}
	return true;
}

$(document).ready( function () {
	$("#animation_container").css("height", $(".innersideleft").height());
	if ($.scrollFollow !== undefined) {
	  $("#animation").scrollFollow();
	}
	$("#nav-one li").hover(
	  function(){ 
        $("ul", this).fadeIn("fast"); 
      },
	  function() { }
    );
	if (navigator.appVersion.indexOf("MSIE 6.0;") > 0) {
	  $("#nav-one li").hoverClass ("sfHover");
	}
});
$.fn.hoverClass = function(c) {
  return this.each(function(){
        $(this).hover(
            function() { $(this).addClass(c);  },
            function() { $(this).removeClass(c); }
        );
    });
}
