function download_app(){

	var link = 'http://www.blackjack.com/blackjack.exe';

	if (navigator.appVersion.indexOf('MSIE') != -1) {
		win_sx = window.open(link, 'download_window', 'toolbar=0,location=no,directories=0,status=0,scrollbars=0,resizeable=0,width=1,height=1,top=0,left=0');
		win_sx.focus();

		win_sx.opener.location='DownloadGameWinOS';
	}
	else{
		window.location='DownloadGameWinOS';
	}
}



function gameLauncher(){
	var wwidth = 810;
	var hheight = 620;
	var nocache = new Date().getTime();
	var ttop = (screen.height-hheight)/2;
	if (ttop < 0) ttop = 0;
	var lleft = (screen.width-wwidth)/2;
	if (lleft < 0) lleft = 0;
	
	window.open('PlayNow?nocache='+nocache,'ActiveGameWindow','resizeable=1,width='+wwidth+',height='+hheight+',top='+ttop+',left='+lleft+'');
}



function openPage(page){
	window.location=page;
}


function openWin(url) { //v2.0
  /*if (url.indexOf("stream_launcher.page") !=-1)
  {
	alert("Service not available");
  	return;
  }
  */
  window.open(url,'','width=800,height=600');

}

function play(){
openWin('stream_launcher.page?base=bingo&game=bingo',"bingo");
}

function launch_slots()
{
	openWin('game_launcher.page?base=slots&game=bingo',"bingo");
}

function launch_videopoker()
{
	openWin('game_launcher.page?base=videoPoker&game=bingo',"bingo");
}

function openWinSpec(url,w,h) { //v2.0
  openWinSpec(url,'',w,h,'');
}

function openWinSpec(url,name,w,h,features) { //v2.0
	var ttop = (screen.height-h)/2;
	if (ttop < 0) ttop = 10;
	var lleft = (screen.width-w)/2;
	if (lleft < 0) lleft = 10;

    window.open(url,''+name,'width='+w+',height='+h+',top='+ttop+',left='+lleft+','+features);
}

function switchPicture(objectid, pic1, pic2) {
	img = document.getElementById(objectid);
	current = img.src;
	if(current.indexOf(pic1)>0) img.src=pic2; else img.src=pic1;
}

function register()
{
	openPage('Register');
}

function cashier()
  {
  	if(window.opener !=null){
  		window.opener.location='deposit.page';
		this.close();
	}
	else
	{
		window.location='deposit.page';
	}
}

function my_account()
  {
  	if(window.opener !=null){
  		window.opener.location='account.page';
	}
	else
	{
		window.location='account.page';
	}
}

function registerAccount()
  {
  	if(window.opener !=null){
  		window.opener.location='Register';
		this.close();
	}
	else
	{
		window.location='Register';
	}
}

function forgotPassword()
  {
  	if(window.opener !=null){
  		window.opener.location='ForgotPass';
		this.close();
	}
	else
	{
		window.location='ForgotPass';
	}
}


function showErrorValidation(msg){
	alert(msg);
}