function upopup(url,w,h,s,n){
	var x;
	var l = (window.screen.width-w)/2;
	var t = (window.screen.height-h)/2; 
	x = window.open(url,n,"height="+h+",width="+w+",status=no,toolbar=no,menubar=no,location=no,scrollbars="+s+",left="+l+",top="+t);
    x.window.focus();
}

function Download(buttonId){
    if(buttonId==null) buttonId="0000";
  	var urlStr = window.location.href;
  	var pageLang = "en";  
 	var urlStrArray = urlStr.split("/");						//seperate url into array, "/" is the seperator
  	var pageStr = urlStrArray[urlStrArray.length-1];			//page name is the last in the array
  	var len = pageStr.indexOf("."); 							//find seperator between file name and extension
  	var pageName = pageStr.substr(0,len);						//seperate file name from extension (save file name)
	if(pageName=="") pageName = "index";						//if ".com" address with no actual file
  	var finalStr = pageLang + "+" + pageName + "+" + buttonId;	//"+" is the seperator of the final string
	finalStr = replaceWith(finalStr,"_","-");					//replace all the "_" with "-" because the cgi won't accept "_".
  	parent.window.location.href="ftp://ftp.ultimatebet.com/public_html/releases/pinuppoker/active/ubsetup.exe";
	//+finalStr;
	//alert("http://banner.clubdicecasino.com/cgi-bin/SetupCasino.exe?creferer=DLB:"+finalStr);
}

function replaceWith(str,char2find,char2replace){
  var newStr = "";
  for(var i=0 ; i<str.length ; i++)
    if(str.charAt(i) == char2find)
	  newStr += char2replace;
	else
	  newStr += str.charAt(i);
  return newStr;
}

function parentgoto(url){
    var isIE = document.all?true:false;		//true if browser is IE, false if Netscape
	var win;
	var base = 'http://www.pinuppoker.com';
	if(!window.name)						//if never was a parent window (case 1)
	  win = window.open(base);	//open new one
	else{									//if there is a parent (case 2)
	  win = window.opener;					//find it
	  if(!win)								//if couldn't find (netscape friendle opener trouble)
	    win = window.open(base);	//open new one
	  if(win.closed)						//if it was closed (case 3)
	    win = window.open(base);	//open new one
	}  
	
	try{
	  win.mainFrame.location.href = url;
	}
	catch(e){
	  win.location.href = url;
	}
	win.focus();
}