// Cross Browser DOM
// copyright Stephen Chapman, 4th Jan 2005
// you may copy this code but please keep the copyright notice as well
var aDOM = 0, ieDOM = 0, nsDOM = 0; var stdDOM = document.getElementById;
if (stdDOM) aDOM = 1; else {ieDOM = document.all; if (ieDOM) aDOM = 1; else {
var nsDOM = ((navigator.appName.indexOf('Netscape') != -1)
&& (parseInt(navigator.appVersion) ==4)); if (nsDOM) aDOM = 1;}}


function xDOM(objectId, wS) {
if (stdDOM) return wS ? document.getElementById(objectId).style:
document.getElementById(objectId);
if (ieDOM) return wS ? document.all[objectId].style: document.all[objectId];
if (nsDOM) return document.layers[objectId];
}                  

function formfieldempty()
{
    if ( document.myform.name.value == '' )
    {
        alert('Sorry. No name was entered!')
        return false;
    }
    if ( document.myform.email.value == '' )
    {
        alert('Sorry. No e-mail was entered!')
        return false;
    }
	
}

function calledfrom(twocharalbum, albumname)
{
var visited = getQuerystring('caller');

if (visited==null) visited=""; 
var fullalbum = twocharalbum + "_player.htm?bk=" + visited;
window.open( fullalbum,"remote","width=420, height=200,resizable=no");
}

function callplayer(twocharalbum, albumname, visited)
{
var objstring   = '<object type="application/x-shockwave-flash" data="http://www.suntowermusic.com/xspf/xspf_player.swf?playlist_url=http://www.suntowermusic.com/xspf/' + albumname + visited + '.xspf&autoplay=true&repeat_playlist=true&player_title=KICK&playlist_size=3" width="400" height="151">';

var paramstring = '<param name="movie" value="http://www.suntowermusic.com/xspf/xspf_player.swf?playlist_url=http://www.suntowermusic.com/xspf/' + albumname + visited + '.xspf&repeat_playlist=true&player_title=KICK&playlist_size=3"/>';

document.write(objstring);
document.write(paramstring);
document.write('</object>');
}

function winopen(u,w,h)
{
wi = "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=yes,width=" ;
wi += w;
wi += ",height=";
wi += h;

msg=open("","newwindow",wi);
msg.document.write("<img border='0' src='");
msg.document.write(u);
msg.document.write("'>");
}

function popupwindow(mypage,myname,w,h,scroll,pos)
{
  //confirm(mypage);
  var win=null;
  if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
  if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h-100)/2:100;}
  else if((pos!="center" && pos!="random") ||
  pos==null){LeftPosition=0;TopPosition=20}
  settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=yes,menubar=no,toolbar=no,resizable=yes';
  win=open(mypage, "",settings); win.focus();
}

function getQuerystring(key, default_)
{if (default_==null) default_="";
  key = key.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
  var regex = new RegExp("[\\?&amp;]"+key+"=([^&amp;#]*)");
  var qs = regex.exec(window.location.href);
  if(qs == null)
    return default_;
  else
    return qs[1];
}

function popupimage(myimage,w,h,scroll,pos)
{
  var win=null;
  if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
  if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h-100)/2:100;}
  else if((pos!="center" && pos!="random") ||
  pos==null){LeftPosition=0;TopPosition=20}
  settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=yes,menubar=no,toolbar=no,resizable=yes';
  // confirm("test.htm");
  win=open("test.htm","",settings);
  win.document.write("<HTML><BODY><img src='" + myimage + "'></BODY></HTML>");
  win.focus();
}

function albumcovermover()
{
var x = (posRight() - 250 ) + 'px';
var y = (posBottom()- 200 ) + 'px';
moveObjTo('movingalbumcover',x,y);
setObjVis('movingalbumcover','visible');
}

function objWidth(objectID) {var obj = xDOM(objectID,0); if(obj.offsetWidth) return  obj.offsetWidth; if (obj.clip) return obj.clip.width; return 0;}

function objHeight(objectID) {var obj = xDOM(objectID,0); if(obj.offsetHeight) return  obj.offsetHeight; if (obj.clip) return obj.clip.height; return 0;}

function objLeft(objectID) {var obj = xDOM(objectID,0);var objs = xDOM(objectID,1); if(objs.left) return objs.left; if (objs.pixelLeft) return objs.pixelLeft; if (obj.offsetLeft) return obj.offsetLeft; return 0;}

function objTop(objectID) {var obj = xDOM(objectID,0);var objs = xDOM(objectID,1); if(objs.top) return objs.top; if (objs.pixelTop) return objs.pixelTop; if (obj.offsetTop) return obj.offsetTop; return 0;}

function objRight(objectID) {return objLeft(objectID)+objWidth(objectID);}

function objBottom(objectID) {return objTop(objectID)+objHeight(objectID);}

function objLayer(objectID) {var objs = xDOM(objectID,1); if(objs.zIndex) return objs.zIndex; return 0;}

function objVisible(objectID) {var objs = xDOM(objectID,1); if(objs.visibility == 'hide' || objs.visibility == 'hidden') return 'hidden'; return 'visible';}

function pageWidth() {return window.innerWidth != null? window.innerWidth : document.documentElement && document.documentElement.clientWidth ?       document.documentElement.clientWidth : document.body != null ? document.body.clientWidth : null;}

function pageHeight() {return  window.innerHeight != null? window.innerHeight : document.documentElement && document.documentElement.clientHeight ?  document.documentElement.clientHeight : document.body != null? document.body.clientHeight : null;}

function posLeft() {return typeof window.pageXOffset != 'undefined' ? window.pageXOffset :document.documentElement && document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft ? document.body.scrollLeft : 0;}

function posTop() {return typeof window.pageYOffset != 'undefined' ?  window.pageYOffset : document.documentElement && document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop ? document.body.scrollTop : 0;}

function posRight() {return posLeft()+pageWidth();}
function posBottom() {return posTop()+pageHeight();}

// More Object Functions
// copyright Stephen Chapman, 18th Jan 2005
// you may copy these functions but please keep the copyright notice as well
function setObjVis(objectID,vis) {var objs = xDOM(objectID,1); objs.visibility = vis;} 

function toggleObjVis(objectID) {var objs = xDOM(objectID,1); var vis = objs.visibility;  objs.visibility = (vis == "visible" || vis == "show") ? 'hidden' : 'visible';} 

function moveObjTo(objectID,x,y) {var objs = xDOM(objectID,1); objs.left = x; objs.top = y;}

function moveObjBy(objectID,x,y) {var obj = xDOM(objectID,0);var objs = xDOM(objectID,1); if (obj.offsetLeft != null) {var l = obj.offsetLeft; var t = obj.offsetTop; objs.left = l+x; objs.top = t+y;} else if (objs.pixelLeft != null) {objs.pixelLeft += x; objs.pixelTop += y;} else obj.moveBy(x,y);}

function moveObjLayer(objectID,z) {var objs = xDOM(objectID,1); objs.zIndex = z;}
                    
var ad_array;
ad_array = new Array();
ad_array[0]="<a href=safeext.htm>";
ad_array[0]+="<img SRC=webext.jpg></a>";
ad_array[1]="<A href=safeext.htm>";
ad_array[1]+="<img SRC=telefext.jpg></a>";
ad_array[2]="<A href=safeext.htm>";
ad_array[2]+="<img SRC=secext.jpg></a>";
ad_array[3]="<A href=safeext.htm>";
ad_array[3]+="<img SRC=conext.jpg></a>";
ad_array[4]="<A href=safeext.htm>";
ad_array[4]+="<img SRC=roxext.jpg></a>";


function getad()
{ var s;
  var n;
  n=Math.round(Math.random()*(ad_array.length-1));
  s=ad_array[n];
 return s;
 }

 function rotate()
  { advert.innerHTML=getad();
   window.setTimeout("rotate();",2000);
 }
					