function getImages(){
	
	var preLoad = new Array();
    for( var i=0; i < imgArray.length; ++i){
		preLoad[i] = new Image();
		preLoad[i].src = imgArray[i];
	}
}

function rotImage(myDiv){
	
	var ubImg = imgArray.length;
	var rndImg = Math.round(Math.random()*(ubImg-1));
	document.images.rot_img.src = imgArray[rndImg];
	//$(myDiv).src = '<img src="'+imgArray[rndImg]+'">';
	//$(myDiv).src = imgArray[rndImg];
	//alert(imgArray[0].src.value + ' / ' + rndImg);
	
}
/* Show or Hide advanced search
 * #searchoptions defaulted to display:none
 */

function bookingOptions(action) {
    if (action == 'on') {
        var obj1 = document.getElementById('booking-form');
        var obj2 = document.getElementById('online-booking');
    } else {
        var obj1 = document.getElementById('online-booking');
        var obj2 = document.getElementById('booking-form');
    }
    obj1.style.display = 'block';
    obj2.style.display = 'none';
	
}


function openWindow(theURL, theName, width, height)
{
	theWindow = window.open(theURL , ""+theName+"" ,"width=" + width + ",height="+ height + ",toolbar=no,directories=0,menubar=no,status=no,resizable=1,location=0,scrollbars=1,copyhistory=0,alwaysRaised=yes");
	theWindow.title = theName;
	theWindow.focus();
}
	
function PadDigits(n, totalDigits) 
{ 
    n = n.toString(); 
    var pd = ''; 
    if (totalDigits > n.length) 
    { 
        for (i=0; i < (totalDigits-n.length); i++) 
        { 
            pd += '0'; 
        } 
    } 
    return pd + n.toString(); 
} 

function copy(text2copy) {
	alert("Copying the following text to the Clipboard:\n\n" + text2copy + "\n");
  if (window.clipboardData) {
    window.clipboardData.setData("Text",text2copy);
  } else {
    var flashcopier = 'flashcopier';
    if(!document.getElementById(flashcopier)) {
      var divholder = document.createElement('div');
      divholder.id = flashcopier;
      document.body.appendChild(divholder);
    }
    document.getElementById(flashcopier).innerHTML = '';
    var divinfo = '<embed src="/VanillaSite/admin/include/_clipboard.swf" FlashVars="clipboard='+escape(text2copy)+'" width="0" height="0" type="application/x-shockwave-flash"></embed>';
	document.getElementById(flashcopier).innerHTML = divinfo;
  }
}

