/**
* ksgame customfuncs
*
* @author		Frank Schnappenberger
* @copyright	triple-i new media system design gmbh
* @version		0.0.1
*/

function CheckFlash()
{
	window.setTimeout('NoFlash()',5000);
}

function NoFlash()
{
	document.location.href = 'noflash.htm';
}

function OpenImprint()
{
	url = (document.URL.indexOf('html/')!=-1) ? 'credits.htm' : 'html/credits.htm';

	imprint = CreateWindow(url,'imprint',400,560);
	imprint.focus();
}

function OpenDataSecurity()
{
	url = (document.URL.indexOf('html/')!=-1) ? 'datasecurity.htm' : 'html/datasecurity.htm';

	data_sec = CreateWindow(url,'datasec',400,560,'scrollbars');
	data_sec.focus();
}

function OpenSendPassword()
{
	sendpassword = CreateWindow('sendpassword.php','send',400,560);
	sendpassword.focus();
}

function CenterMe()
{
	window.moveTo(30,30);
}

/*
* Creates a new browser window.
*
* @param    string  url to load in new window
* @param    string  name of new window
* @param    string  width of new window (optional, uses default size if omitted)
* @param    string  height of new window (optional, uses default size if omitted)
* @param    string  string containg attribs the new window should have (optional,
                    default is everything on, use an empty string to turn everything,
                    off, certain attribute keywords to activate these attributes)
* @returns  object  window object of created window
*/
function CreateWindow(url,name,w,h,attribs) {
  var menubar=0;
  var toolbar=0;
  var locationbar=0;
  var personalbar=0;
  var statusbar=0;
  var scrollbars=0;
  var resizable=0;
  if(typeof(w)=='undefined') { var w=0; }
  if(typeof(h)=='undefined') { var h=0; }
  if(typeof(attribs)=='undefined'||attribs=='none') { var attribs=''; }
  else if(attribs.match('all')||attribs.match('every')) {
    menubar=1;
    toolbar=1;
    locationbar=1;
    personalbar=1;
    statusbar=1;
    scrollbars=1;
    resizable=1;
  } else {
    if(attribs.match('menu')) { menubar=1; }
    if(attribs.match('tool')) { toolbar=1; }
    if(attribs.match('loc')) { locationbar=1; }
    if(attribs.match('pers')) { personalbar=1; }
    if(attribs.match('stat')) { statusbar=1; }
    if(attribs.match('scroll')) { scrollbars=1; }
    if(attribs.match('resiz')) { resizable=1; }
  }
  attribs='';
  if(w>0) { attribs+='width='+w; }
  if(h>0) {
    if(attribs!='') { attribs+=','; }
    attribs+='height='+h;
  }
  if(attribs!='') { attribs+=','; }
  attribs+='menubar='+menubar+',toolbar='+toolbar+',location='+locationbar;
  attribs+=',personalbar='+personalbar+',status='+statusbar+',scrollbars='+scrollbars;
  attribs+=',resizable='+resizable;
  return window.open(url,name,attribs);
}