function doRedir(url)
{
window.location=url;
}
function closewindow()
{
window.opener=null;
window.close();
}
function openwindow(url,name,features)
{
var win = window.open(url,name,'toolbar=0,resizable=1,scrollbars=1,left=0,top=0,width=' + (screen.availWidth - 10) + ',height=' + (screen.availHeight - 30));;
if (win == null)
{
//alert('Open window error.\n\nYou may be using a popup blocker that incorrectly blocked our game play window.\nClick ok to open the game window.');
window.location = url;
}
return false;
}
function opensmallwin(url,name)
{
var win = window.open(url,name,'toolbar=0,width=650,height=550,resizable=1,scrollbars=1');
if (win == null)
{
//alert('Open window error.\n\nYou may be using a popup blocker that incorrectly blocked our game play window.\nClick ok to open the game window.');
window.location = url;
}
return false;
}
function oc(linkObj)
{
var sUrl = linkObj.href;
if (sUrl.indexOf('http:') < 0)
sUrl = 'http://www.yupgames.com' + '/' + sUrl; // http not specified so add it
var sSplit = sUrl.split("/");
var sWinName = sSplit[3];
sWinName = sWinName.replace('-','').replace('_',''); // remove - or _ as doesnt work
var sOptions = 'toolbar=0,resizable=1,scrollbars=0,left=0,top=0,width=' + (screen.availWidth - 10) + ',height=' + (screen.availHeight - 30);
var win = window.open(sUrl,sWinName,sOptions);
if (win == null)
{
// probably popup blocker... attempt to open
window.location = sUrl;
}
return false;
}
function addBookmark(url,title)
{
if (navigator.userAgent.toUpperCase().indexOf('FIREFOX') >= 0)
{
window.sidebar.addPanel(title, url,"");
return false;
}
else if (navigator.userAgent.toUpperCase().indexOf('MSIE') >= 0)
{
window.external.AddFavorite(url,title);
return false;
}
}
function setHomePage(obj)
{
obj.style.behavior='url(#default#homepage)';
obj.setHomePage('http://www.yupgames.com');
}
function ShowPopAd(type)
{
if (type == "vclick")
{
var dc=document; var date_ob=new Date();
dc.cookie='h2=o; path=/;';var bust=date_ob.getSeconds();
if(dc.cookie.indexOf('e=llo') <= 0 && dc.cookie.indexOf('2=o') > 0){
dc.write('');
date_ob.setTime(date_ob.getTime()+43200000);
dc.cookie='he=llo; path=/; expires='+ date_ob.toGMTString();}
}
}
function getfile(file,spawnpage)
{
var win = window.open(file,'downloading','toolbar=0,location=no,directories=0,status=0, scrollbars=no,resizable=0,width=1,height=1,top=0,left=0');
if (win != null)
{
win.focus();
}
location.href = spawnpage;
return false;
}
function killiframe()
{
if (top.location != self.location)
{
top.location = self.location.href;
}
}
function setCookie(name, value, expires, path, domain, secure)
{
document.cookie= name + "=" + escape(value) + ((expires) ? "; expires=" + expires.toGMTString() : "") +
((path) ? "; path=" + path : "") + ((domain) ? "; domain=" + domain : "") + ((secure) ? "; secure" : "");
}
function getCookie(name)
{
var dc = document.cookie;
var prefix = name + "=";
var begin = dc.indexOf("; " + prefix);
if (begin == -1)
{
begin = dc.indexOf(prefix);
if (begin != 0) return null;
}
else
{
begin += 2;
}
var end = document.cookie.indexOf(";", begin);
if (end == -1)
{
end = dc.length;
}
return unescape(dc.substring(begin + prefix.length, end));
}
function deleteCookie(name, path, domain)
{
if (getCookie(name))
{
document.cookie = name + "=" + ((path) ? "; path=" + path : "") +
((domain) ? "; domain=" + domain : "") + "; expires=Thu, 01-Jan-70 00:00:01 GMT";
}
}
function isFieldBlank(theField)
{
var val = ltrim(rtrim(theField.value));
if(val == "")
return true;
else
return false;
}
function ltrim(str)
{
for(var k = 0; k < str.length && isWhitespace(str.charAt(k)); k++);
return str.substring(k, str.length);
}
function rtrim(str)
{
for(var j=str.length-1; j>=0 && isWhitespace(str.charAt(j)) ; j--) ;
return str.substring(0,j+1);
}
function isWhitespace(charToCheck)
{
var whitespaceChars = " \t\n\r\f";
return (whitespaceChars.indexOf(charToCheck) != -1);
}
function showMoreCat(showIt)
{
var obj = document.getElementById('moreCat');
if (showIt)
{
obj.className='showIt';
}
else
{
obj.className='hideIt';
}
return false;
}
function open_download(downloadUrl)
{
var uAgent = navigator.userAgent.toLowerCase();
var isIE = (uAgent.indexOf("msie") >= 0);
if (isIE)
{
window.open(downloadUrl,'downloadHelperWin','toolbar=0,location=no,directories=0,status=0,scrollbars=yes,resizable=1,width=1,height=1,top=0,left=0');
}
return true;
}
function showToolbar()
{
/*
// commented out for now. It broke IE6 and got extremely low response rate so not worth it
var oToolbar = new TPI.Toolbar("CT2383902");
var oRtn = oToolbar.GetInfo();
if (!oRtn.returnValue)
{
// toolbar is not installed so show it
var outputHtml = '
';
var obj = document.getElementById('toolbarArea');
obj.innerHTML = outputHtml;
}
*/
}