
//if (top == self) self.location.href = "index.php";

var pp=0; //fortimeout

function lib_bwcheck(){ //Browsercheck (needed)
	this.ver=navigator.appVersion
		this.agent=navigator.userAgent
		this.dom=document.getElementById?1:0
		this.opera5=this.agent.indexOf("Opera 5")>-1
		this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom && !this.opera5)?1:0;
	this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom && !this.opera5)?1:0;
	this.ie4=(document.all && !this.dom && !this.opera5)?1:0;
	this.ie=this.ie4||this.ie5||this.ie6
		this.mac=this.agent.indexOf("Mac")>-1
		this.ns6=(this.dom && parseInt(this.ver) >= 5) ?1:0;
	this.ns4=(document.layers && !this.dom)?1:0;
	this.bw=(this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns6 || this.opera5)
	
	return this
}
var bw=new lib_bwcheck()




var alreadyshowing = new Array (0,0);
var abc=new Array("a", "b", "c", "d", "e", "f","g","h");
var isthere=0;
var i=0;

function fmovelayers() { //v1.2
	var startnumber, numosubs,theObj, dvname, subname,additional,k ,j,l ;
	numosubs= arguments[0] ;
	startnumber = arguments[1];
	isthere=isthere+1;
	i=i+1;
	
	dvname="d"+ i ;
	
	var objstr=bw.dom? document.getElementById(dvname):bw.ie4?document.all[dvname]:bw.ns4?eval("document.layers."+dvname):0;
	theObj = objstr;
	
	if ( i<= startnumber)
	{ additional=0;}
		else{
			additional=(numosubs*18) ;
	} //end else
	topstr = 122 + (i*22)+ additional;
	
	

	if (navigator.appName == 'Netscape' && document.layers != null) {
		if (theObj) theObj.top =topstr;
	} //end if
	else if (document.getElementById  || document.all) { //IE
		
		if (theObj) theObj.style.top =topstr;
	} //else if
	
	
	if (isthere <= 13){
		var tmrn=30;
		setTimeout("fmovelayers("+numosubs+","+startnumber+")", tmrn);
	}//if
	
	
}  ///end movelayers

////////////////////////////////////////////////////
///////////////////////////////////
function movelayers(){

if (alreadyshowing[1] ==arguments[1] )
{
arguments[1]=13;
arguments[0]=13;

}	
	i=0;
	isthere=0;
	l=0;
	if (alreadyshowing[0] !=0){

		hidesubs(alreadyshowing[0], alreadyshowing[1]);

	}//end if already
	
	


	histhere=0;
	l=0;
	showsup( arguments[0]  , arguments[1] );
	i=0;
	isthere=0;
	fmovelayers( arguments[0],arguments[1] );
	

	///////////////////////////////hidesubs
	alreadyshowing[0]=arguments[0] ;
	alreadyshowing[1] =arguments[1] ;
	

}
///////////////////////////show subs


function hidesubs(zero,one)
{
	
	for (l=0; l<zero ; l++) {
		
		
		subname="d"+ one  + abc[l];
		objstr=bw.dom? document.getElementById(subname):bw.ie4?document.all[subname]:bw.ns4?eval("document.layers."+subname):0;
		theObj=objstr;
		if (navigator.appName == 'Netscape' && document.layers != null) {
			if (theObj) theObj.visibility = "hidden";
		}  // if
		else if (document.getElementById  || document.all )  { //IE
			
			if (theObj) theObj.style.visibility = "hidden";
		} //end else
	}//end for
	
}  //end hidesubs




var l=0;
var histhere=0;
function showsup(numosubs , startnumber){
	numosubs= arguments[0] ;
	startnumber = arguments[1];
	histhere=histhere+1;
	
	
	var subname ;
	
	
	
	subname="d"+ startnumber  + abc[l];

	
	
	objstr=bw.dom? document.getElementById(subname):bw.ie4?document.all[subname]:bw.ns4?eval("document.layers."+subname):0;
	theObj=objstr;
	if (navigator.appName == 'Netscape' && document.layers != null) {
		if (theObj) theObj.visibility = "visible";
	}  // if
	else if (document.getElementById  || document.all )  { //IE
		
		if (theObj) theObj.style.visibility = "visible";


	} //end else
	l=l+1;
	if (histhere <= numosubs){
		var tmrn=30;
		setTimeout("showsup("+numosubs+","+startnumber+")", tmrn);
	}//if
	
	
	
} //end showup




////////////////////////////////


 theobject=document.getElementById("lowsatgrn");

function high(){
if (bw.dom){
theobject=document.getElementById("lowsatgrn");
highlighting=setInterval("highlightit(theobject)",100)
}
}

function low(){
theobject=document.getElementById("lowsatgrn");
lowlighting=setInterval("lowlightit(theobject)",100)
}



function highlightit(cur2){

if (cur2.style.MozOpacity<1)
{
cur2.style.MozOpacity=parseFloat(cur2.style.MozOpacity)+0.1
}

else {
            if (cur2.filters&&cur2.filters.alpha.opacity<100){
             cur2.filters.alpha.opacity+=10
              }
            else { 
                       if (window.highlighting){
                               clearInterval(highlighting);
                         var tm=setTimeout("low()",500);
                       }}}



}//function



function highlightit2(cur2){

if (cur2.style.MozOpacity<1)
{
cur2.style.MozOpacity=parseFloat(cur2.style.MozOpacity)+0.1
}

else {
            if (cur2.filters&&cur2.filters.alpha.opacity<100){
             cur2.filters.alpha.opacity+=10
              }
            else { 
                       if (window.highlighting){
                               clearInterval(highlighting);
                     
                       }}}



}//function


function lowlightit(cur2){

if (cur2.style.MozOpacity<1)
{
cur2.style.MozOpacity=parseFloat(cur2.style.MozOpacity)+0.1
}

else {
            if (cur2.filters&&cur2.filters.alpha.opacity>0){
             cur2.filters.alpha.opacity-=10
              }
            else { 
                       if (window.highlighting){
                               clearInterval(lowlighting);
                               var td=setTimeout("high()",500);
                       }}}

}




function pop()
{
var noresargs="status=no, resizable=yes, width=800 , height=550, scrollbars=yes";
var myres=window.open("NewNews.php", "sorryNores", noresargs);

}



function popsecuredeposit() {
 var noresargs="status=yes, resizable=no, width=450 , height=500, scrollbars=yes";
var myres=window.open("https://www.bimcomp.com/secure/shack.php", "sorryNores", noresargs);

}

function popsecure()
{
var noresargs="status=yes, resizable=no, width=723 , height=500, scrollbars=yes";
var myres=window.open("shackvoucherInner.php", "sorryNores", noresargs);

}

////////////rotate pictures

// =======================================
// set the following variables
// =======================================

// Set slideShowSpeed (milliseconds)
var slideShowSpeed = 3000

// Duration of crossfade (seconds)
var crossFadeDuration = 3

// Specify the image files
var Pic = new Array() // don't touch this
// to add more images, just continue
// the pattern, adding to the array below

Pic[0] = 'slide/2.jpg'
Pic[1]  = 'slide/3.jpg'
Pic[2]   = 'slide/4.jpg'
Pic[3]   = 'slide/1.jpg'
//Pic[4]   = 'slide/6.jpg'
//Pic[5]   = 'slide/7.jpg'
//Pic[6]   = 'slide/8.jpg'
//Pic[7]   = 'slide/9.jpg'
//Pic[8]   = 'slide/1.jpg'

// =======================================
// do not edit anything below this line
// =======================================

var t
var j = 0
var p = Pic.length

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

function runSlideShow(){
   if (document.all){
      document.images.SlideShow.style.filter="blendTrans(duration=2)"
      document.images.SlideShow.style.filter="blendTrans(duration=crossFadeDuration)"
      document.images.SlideShow.filters.blendTrans.Apply()      
   }

   document.images.SlideShow.src = preLoad[j].src
   if (document.all){
      document.images.SlideShow.filters.blendTrans.Play()
   }
   j = j + 1
   if (j > (p-1)) j=0
   t = setTimeout('runSlideShow()', slideShowSpeed)
}   


//========================forform

function UpdDate(themonth,theday,theyear){
document.ReservationRequest.Date.options[theday - 1].selected = true;
document.ReservationRequest.Month.options[themonth-1].selected = true;
document.ReservationRequest.Year.options[theyear].selected = true;
}




function addorremove(){
if (document.getElementById){
var element = document.getElementById('Date'); 
var melement = document.getElementById('Month'); 
var melementval=melement.selectedIndex;
var newone29 = new Option('29','29'); 
var newone30 = new Option('30','30'); 
var newone31 = new Option('31','31'); 


if (melementval ==8 ||melementval ==3 ||melementval ==5 ||melementval ==10 ){  ///30
if (element.length ==31)
{element.remove(30); }//end if len=31
if (element.length ==28)
{element.add(newone29,29); 
element.add(newone30,30); }//end if len=28

}//end if (melementval ==8...


else if (melementval ==1 ) //feb
{

if (element.length ==31)
{element.remove(30); element.remove(29);element.remove(28); }//end if len=31
if (element.length ==30)
{element.remove(29);element.remove(28); }//end if len=30
 } //feb


else{  //31
if (element.length ==30)
{element.add(newone31,31); }//end if len=30

if (element.length ==28)
{element.add(newone29,29); 
element.add(newone30,30); 
element.add(newone31,31); 
}//end if len=28


}




} ///if (document.getElementById){
}
///////////////


function writeemail(name , domain){
var emailnameanddomain= name + "@" +  domain ;
document.write ("<a href=\"mailto:"); 
document.write (emailnameanddomain + "\"  class=\"white\" > " +  name + "@" +  domain +  "</a>" ); 
}


///////////////////////gallery

function swapmainimg(sbin){


theimg=document.getElementById('igal55');//<?php print $i;?>

theimg.src=sbin;



}


function Validate()
{

if (  (document.DetailsForm.email.value == '') || (document.DetailsForm.email.value == null) ||  (invalidemail(document.DetailsForm.email.value)))
    { 
alert('You must enter a valid email address.');
document.DetailsForm.email.focus();
    return false;
    }

else{
     return true;
}
} //end function


function invalidemail(email)
{
var invalidchars = ' /:;';
for (i=0;i<invalidchars.length;i++)
    {
var badchar = invalidchars.charAt(i);
if (email.indexOf(badchar,0) != -1)
    {
    return true;
    }
}
var atpos = email.indexOf('@',1);
if (atpos == -1)
    {
    return true;
    }
if (email.indexOf('@',atpos+1) != -1)
    {
    return true;
    }
var periodpos = email.indexOf('.',atpos);
if (periodpos == -1)
    {
    return true;
    }
if (periodpos+3 > email.length)
    {
    return true;
    }
return false;
}



function checkemail(){

var emailbox = document.getElementById('username');
if (emailbox.value.indexOf('@')>=1 && emailbox.value.indexOf('@')< emailbox.value.length-4 ){
return true;
}//end if
else{
alert('Please include a valid email address');
return false;
}//end else
}//end checkemail

