// JavaScript Document

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}


/*
Auto center window script- Eric King (http://redrival.com/eak/index.shtml)
Permission granted to Dynamic Drive to feature script in archive
For full source, usage terms, and 100's more DHTML scripts, visit http://dynamicdrive.com
*/

var win = null;
function NewWindow(mypage,myname,w,h,scroll){
LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
settings =
'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+''
win = window.open(mypage,myname,settings)
}
              

function launchConsoleWeather(){
var consoleWindow=window.open("http://news.bbc.co.uk/broadband/weather_console.stm?source=Skymarket","consoleWindow","width=671,height=373,toolbar=0,location=0,menubar=0,scrollbars=0,status=0");
consoleWindow.focus();
}


function launchConsoleSport(){
var consoleWindow=window.open("http://news.bbc.co.uk/broadband/sport_console.stm?source=skymarket","consoleWindow","width=671,height=373,toolbar=0,location=0,menubar=0,scrollbars=0,status=0");
consoleWindow.focus();
}


function launchConsoleEnts(){
var consoleWindow=window.open("http://www.bbc.co.uk/broadband/entertainment?source=skymarket","consoleWindow","width=676,height=510,toolbar=0,location=0,menubar=0,scrollbars=0,status=0,resizable=1");
consoleWindow.focus();
}


function launchConsoleNews(){
var consoleWindow=window.open("http://news.bbc.co.uk/broadband/news_console.stm?source=skymarket","consoleWindow","width=676,height=373,toolbar=0,location=0,menubar=0,scrollbars=0,status=0,resizable=1");
consoleWindow.focus();
}


function checkdomain()
{
  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-0123456789";
  var checkStr = document.forms["searchform"].elements["name"].value;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("You can only use numbers, letters and the dash ( - ) sign in your domains");
    return (false);
  }
  if (checkStr.length<3)
  {
    alert("You must provide more than two letters or numbers to register a domain name");
    return (false);
  }
  if ((checkStr.charAt(0)=="-") || (checkStr.charAt(checkStr.length-1)=="-"))
  {
    alert("Your domain name cannot start with or end with a dash sign. It must start with a letter or number");
    return (false);
  }
  return (true);
}


function asktodelete()
{
  if (document.forms["domainform"].elements["domainlist"].value > 0)
  {
    if (confirm("Are you sure you wish to delete this domain from your shopping basket ?"))
    {
      document.forms["domainform"].elements["deleteconfirmed"].value="Y";
      document.forms["domainform"].submit();
    }
  }
}

/*

Random Image Link Script- By JavaScript Kit(http://www.javascriptkit.com) 

Over 200+ free JavaScripts here!

Updated: 00/04/25

*/
function random_imglink(){

var myimages=new Array()

//specify random images below. You can have as many as you wish

myimages[1]="images/1a.gif"

myimages[2]="images/1b.gif"

myimages[3]="images/1c.gif"



//specify corresponding links below

var imagelinks=new Array()

imagelinks[1]="hosting_linux.php"

imagelinks[2]="packages_homeusers.php"

imagelinks[3]="packages_homeusers.php"

var ry=Math.floor(Math.random()*myimages.length)

if (ry==0)

ry=1

document.write('<a href='+'"'+imagelinks[ry]+'"'+'><img src="'+myimages[ry]+'" border=0></a>')

}

