function launchLiveChat() {
	window.open("/live-chat/index.html", "BingoChat", "height=400,width=600,modal=yes,alwaysRaised=yes");
}

function resetPassword() {
	window.open("https://redirector3.valueactive.eu/casino/default.aspx?applicationID=1059&ServerID=1334&clienttype=1&lang=en", "BingoPasswordReset", "height=400,width=600,modal=yes,alwaysRaised=yes");
}
    
       function formatText(index, panel) {
		  return index + "";
	    }
    
        $(function () {
        
            $('.slotsRotator').anythingSlider({
                easing: "easeInOutExpo",        // Anything other than "linear" or "swing" requires the easing plugin
                autoPlay: true,                 // This turns off the entire FUNCTIONALY, not just if it starts running or not.
                delay: 3000,                    // How long between slide transitions in AutoPlay mode
                startStopped: false,            // If autoPlay is on, this can force it to start stopped
                animationTime: 600,             // How long the slide transition takes
                hashTags: true,                 // Should links change the hashtag in the URL?
                buildNavigation: false,          // If true, builds and list of anchor links to link to each slide
        		pauseOnHover: false,             // If true, and autoPlay is enabled, the show will pause on hover
        		startText: "",             // Start text
		        stopText: "",               // Stop text
		        navigationFormatter: formatText       // Details at the top of the file on this use (advanced use)
            });
           
        });
  
  // Allows us to open external links in new browser tab without using taget="_blank" as this is not xhtml 1.0 complient.
 // All <a href... links with the rel="external" will open in a new browser tab.
  
function externalLinks() {  
 if (!document.getElementsByTagName) return;  
 var anchors = document.getElementsByTagName("a");  
 for (var i=0; i<anchors.length; i++) {  
   var anchor = anchors[i];  
   if (anchor.getAttribute("href") &&  
       anchor.getAttribute("rel") == "external")  
     anchor.target = "_blank";  
 }  
}  
window.onload = externalLinks;


				  
function preLoginCheck()
{

	if (($("input.loginInput").val() == "Account no / alias")||($("input.loginInput").val() == "")){
		alert("Please enter your username")
		$("input.loginInput").focus()
		return false
	}
	
	if (($("input.passwordInput").val() == "password")||( $("input.passwordInput").val() == "")){
		alert("Please enter your password")
		$("input.passwordInput").focus()
		return false
	}
	return true
}



function currencySymbol(currency) //function #7
{
	try{
	currencySymbol[0] = "$";
	currencySymbol[4] = "&yen;";
	currencySymbol[5] = "AU$";
	currencySymbol[6] = "C$";
	currencySymbol[9] = "&pound;";
	currencySymbol[26] = "&euro;";
	currency = currencySymbol[currency];
	return currency;
		}catch (error){
		
		alert(error.message);
		
	}
}

		function facebookShare(){
			
			var u=location.href;
			var t=document.title;
			window.open('http://www.facebook.com/sharer.php?u='+encodeURIComponent(u)+'&t='+encodeURIComponent(t),'sharer','toolbar=0,status=0,width=626,height=436');

		}
		
		function twitterShare(){
			
			var u=location.href;
			var t=document.title;
			window.open('http://twitter.com/share?original_referer='+encodeURIComponent(u)+'&text='+encodeURIComponent(t)+"&via=32Red_Bingo",'sharer','toolbar=0,status=0,width=626,height=436');
			
		}
		
		function myspaceShare(title,description){
			
			var targetUrl = 'http://www.myspace.com/index.cfm?fuseaction=postto&t=' + encodeURIComponent(title)+'&c=' + encodeURIComponent(description) + '&u=' + location.href;
			var targetUrl = targetUrl.replace(/%2520/g, "+");
			window.open(targetUrl, 'ptm', 'height=450,width=440').focus();
			
		}
		
		function blogThis(){
			
		popw='';Q='';x=document;y=window;if(x.selection) {Q=x.selection.createRange().text;} else if (y.getSelection) {Q=y.getSelection();} else if (x.getSelection) {Q=x.getSelection();}popw = y.open('http://www.blogger.com/blog_this.pyra?t=' + escape(Q) + '&u=' + escape(location.href) + '&n=' + escape(document.title),'bloggerForm','scrollbars=no,width=475,height=300,top=175,left=75,status=yes,resizable=yes');if (!document.all) T = setTimeout('popw.focus()',50);void(0);	
			
			
		}
		

		
		 function processLanguageSelection(selection,remove){
				
				//set cookie here.
				if(selection=="es"){
					
					setCookie("language","es",90);
					btagCookie = getCookie("BTAG");
					
					if(btagCookie!=""){
					
						window.location = "http://espanol.32redbingo.com/?BTag="+btagCookie;

					}else{
						
						window.location = "http://espanol.32redbingo.com/";
						
					}
					
				}else if(selection=="en"){
					
					setCookie("language","en",90);
					
					//window.location = "http://www.32red.com";
				}
				if(remove==1){
				removeLangPopup();
				}
			}

			function getCookie(c_name)
			{

				if (document.cookie.length>0){
				  c_start=document.cookie.indexOf(c_name + "=");
				  if (c_start!=-1){
					c_start=c_start + c_name.length+1;
					c_end=document.cookie.indexOf(";",c_start);
					if (c_end==-1) c_end=document.cookie.length;
					return unescape(document.cookie.substring(c_start,c_end));
					}
				  }
				return "";
					
			}

			function setCookie(c_name,value,exdays)
			{
			var exdate=new Date();
			exdate.setDate(exdate.getDate() + exdays);
			var c_value=escape(value) + ((exdays==null) ? "" : "; expires="+exdate.toUTCString());
			document.cookie=c_name + "=" + c_value;
			}
		
			

