//
//	Ugly, slow and mostly a horrible language. DONT USE IT!
//	Copyright 2002 Nicklas Larsson
//
//	Javascript for buttons menu

//	Preload the stupid mouseover images

//	change this to load in the correct order..

    var pic = new Array
    pic[0] = 'img/buttons/v1.png'
    pic[1] = 'img/buttons/v2.png'

    pic[2] = 'img/buttons/f1.png'
    pic[3] = 'img/buttons/f2.png'

    pic[4] = 'img/buttons/h1.png'
    pic[5] = 'img/buttons/h2.png'

    pic[6] = 'img/buttons/k1.png'
    pic[7] = 'img/buttons/k2.png'

    pic[8] = 'img/buttons/s1.png'
    pic[9] = 'img/buttons/s2.png'

    pic[10] = 'img/buttons/j1.png'
    pic[11] = 'img/buttons/j2.png'

    var p = pic.length
    var preLoad = new Array()
    var i = 0;
    for (i = 0; i < p; i++){
	preLoad[i] = new Image()
	preLoad[i].src = pic[i]
    }

//	Switch the image array
function switchImage(whichImage,imageNumber){
   document.images[whichImage].src = preLoad[imageNumber].src
}

// tex. Vi onsker er en trevlig sommar
function dateimg(whichImage){
	    today = new Date();
	    document.images[whichImage].src = 'img/date/',today.getMonth()+1,'.png';
}

function changepic(img_name,img_src){
	document[img_name].src=img_src;
}


// Input box
function of(edit){
//  if (document.all){
    edit.style.border="1 maroon solid";
    //edit.style.margin=2;
//  }
}
function ob(edit){
//  if (document.all){
    edit.style.border="1 gray solid";
    //edit.style.margin=2;
//  }
}
//
function CreateWin(url, width, height) {  
  var xx, yy;
  xx = (screen.width / 2) - (width/2);
  yy = (screen.height / 2) - (height/2);
  win = window.open(url, 'signup', 'width='+width+',height='+height+',toolbar=0,scrollbars=1,location=0,menubar=0,directories=0,resizable=0,status=0,left='+xx+',top='+yy+''); 
  win.moveTo((xx),(yy));
}  
