//TO FORCE A PAGE INTO THE FRAME LAYOUT
function frameMe(cURL){
    //name of the frameset page (be sure to add path info)
    var frameset = cURL;
    //name of the frame to load document into
    var frame = "contentframe";
    page = new String(self.document.location.pathname);
    if(window.name != frame){
      var contents = frameset + "?" + page + "&" + frame;
      top.location.replace(contents);
    }
    return;
  }
 
/*PRELOADING IMAGES WHERE NECESSARY REST OF SCRIPT IN DOC*/
function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

//cloaking my emails

var userName = new Array();  
userName[0]="info"; 
userName[1]="mandy"; 
userName[2]="caren";

var userNameFull = new Array(); 
userNameFull[0]="E-Mail Us"; 
userNameFull[1]="E-Mail Mandy for Accommodation Bookings";
userNameFull[2]="E-Mail Caren for Parties and Function Bookings"; 

var userSubject= new Array()
userSubject[0]="Enquiry from Club Elani Website"; 
userSubject[1]="Accommodation Booking Enquiry from Club Elani Website";
userSubject[2]="Parties and Functions Enquiry from Club Elani Website"; 

var siteName = "clubelani.co.za?subject=";
i=0;
do userName[i]='<a href=\"mailto:' + userName[i] + '@' + siteName + userSubject[i] +'\">' + userNameFull[i] + '</a>';while(userName[++i]);
// end of email section


//webmaster cloaking
//start
var webmasterName = new Array();  
webmasterName[0]="247webmaster";

var webmasterNameFull = new Array(); 
webmasterNameFull[0]="E-Mail our Webmaster for Technical Support";

var webmasterSubject= new Array()
webmasterSubject[0]="Club Elani website - Technical Support Required";

var webmastersiteName = "247highway.com?subject=";
i=0;
do webmasterName[i]='<a href=\"mailto:' + webmasterName[i] + '@' + webmastersiteName + webmasterSubject[i] +'\">'+ webmasterNameFull[i] + '</a>';
while(webmasterName[++i]);
// end of email section
//* **********************************************************************

//OPENS BLOG WINDOW ONCE

function openABlogWindow(theURL,winName,features) { //v2.0
// check if window already exists
if (!ANewBlogWindow || ANewBlogWindow.closed) {
// store new ANewWindow in global var
ANewBlogWindow = window.open(theURL,winName,features);
} else {
//ANewBlogWindow.location = theURL;
ANewBlogWindow.focus();
}
}
//->

//OPENS FORUM WINDOW ONCE

function openAForumWindow(theURL,winName,features) { //v2.0
// check if window already exists
if (!ANewForumWindow || ANewForumWindow.closed) {
// store new ANewWindow in global var
ANewForumWindow = window.open(theURL,winName,features);
} else {
ANewForumWindow.location = theURL;
ANewForumWindow.focus();
}
}
//->

// OPEN NEW MYWINDOW
var abc;
function mywindow(myurl, myname, nwidth){
abc=window.open(myurl, myname, nwidth);
abc.focus();
return false;
}

// SIGNUP SCREEN WINDOW
var signupwindow;
function mysignupwindow(signuppage)
{
         var windowFeatures="left=40,top=50,width=920,height=525 menubar=no,toolbar=no,statusbar=no,scrollbars,resizable";
         signupwindow = window.open(signuppage,"signupnumbers",windowFeatures);
         signupwindow.focus();
         return false;
}


//SCROLLING NEW WINDOW
var myscrollwindow;
function myscrollwindow(myscrollpage)
{
         var windowFeatures="left=25,top=50,width=950,height=550,scrollbars,menubar=yes,toolbar=yes,resizable";
         myscrollwindow = window.open(myscrollpage,"myscrollnumbers",windowFeatures);
         myscrollwindow.focus();
         return false;
}

//VIDEO WINDOW FOR SBI VIDEOS SMALL
var myvideowindow;
function myvideowindow(myvideopage)
{
         var windowFeatures="left=300,top=50,width=500px,height=500px,scrollbars,menubar=no,toolbar=no,resizable";
         myvideowindow = window.open(myvideopage,"myvideonumbers",windowFeatures);
         myvideowindow.focus();
         return false;
}

/********************************************************
* Hide status bar msg II script- by javascriptkit.com 
* Visit JavaScript Kit (http://javascriptkit.com) for script
* Credit must stay intact for use automatically executes this when reading the js file
************************************************* */
function hidestatus(){
window.status=''
return true
}

if (document.layers)
document.captureEvents(Event.MOUSEOVER | Event.MOUSEOUT)

document.onmouseover=hidestatus
document.onmouseout=hidestatus

/***************************************************
* this writes the toddlebabes Cookie
*************************************************/

/************ looks for the toddlebabes and toddleUser cookie to see if visitor has already subscribed ******************/
function GetCookie(name)
{
    var start = document.cookie.indexOf(name+"=");
    var len = start+name.length+1;
    if ((!start) && (name != document.cookie.substring(0,name.length))) return null;
    if (start == -1) return null;
    var end = document.cookie.indexOf(";",len);
    if (end == -1) end = document.cookie.length;
    return unescape(document.cookie.substring(len,end));
}

/********** sets the values for the toddlebabes cookie ********************************/
function DoSetCookie(name,value,expires,path,domain,secure)
{
    document.cookie = name + "=" +escape(value) +
        ( (expires) ? ";expires=" + expires.toGMTString() : "") +
        ( (path) ? ";path=" + path : "") + 
        ( (domain) ? ";domain=" + domain : "") +
        ( (secure) ? ";secure" : "");
}

/********* writes a permanent toddlebabes cookie for subscription **************************/
function SetPermCookie (name, value){
	var now = new Date(); 
	var expval = new Date(); 
	expval.setTime(now.getTime() + (999 *24*3600000));
	DoSetCookie (name, value, expval, "/");
	DoSetCookie("toddleUser", document.fForm.f.value,expval,"/");
    return true;
}


/************* checks to see if toddlebabes cookie exits if it does bypasses the signupform and goes to thanks html page****/
function Loadtoddlebabes(cGoHere){
var name = 'toddlebabes';
if (name != ''  &&  GetCookie(name) == 1) { document.location.replace(cGoHere)};
}


/***** checks to see if toddleUser cookie has been set and uses name or uses friend in html text*********/
function myGetUser(){
var cName = 'Friend';

if (GetCookie("toddleUser") == null) {
   return (cName); 
   } 
else {
	 return (GetCookie("toddleUser"));
	 }
} 

//fynbos TO FORCE A PAGE INTO THE FRAME LAYOUT*****/
function frameMe(cURL){
    //name of the frameset page (be sure to add path info)
    var frameset = cURL;
    //name of the frame to load document into
    var frame = "mainframe";
    page = new String(self.document.location.pathname);
    if(window.name != frame){
      var contents = frameset + "?" + page + "&" + frame;
      top.location.replace(contents);
    }
    return;
  }
  
  
  
  
/*TO OPEN A NEW WINDOW WITH AN EMAIL ADDRESS TELLAFRIEND*/
var smallwindow;
function mySmallWindow(smallpage)
{
         var windowFeatures="left=0,top=300,width=900,height=400";
         smallwindow = window.open(smallpage,"smallinfo",windowFeatures);
         smallwindow.focus();
         return false;
}



/*OPEN A NEW WINDOW TO DISPLAY INDIVIDUAL SIGNUP PAGES AND LP STUFF*/
var maxwindow;
function mymaxwindow(mypage)
{
         var windowFeatures="scrollbars,menubar,left=1,top=1,width=1024,height=768,resizable";
         maxwindow = document.location.replace(mypage,"mydetails",windowFeatures);
         maxwindow.focus();
         return false;
}

//TO OPEN AND CLOSE THUMBNAIL VIEWS
var farmpicswindow;
function farmpicswindow(showpic) {
 		 var winTop= "1"
		 var winLeft=(screen.height/2) -323;
		 var windowFeatures="width=950,height=600,";
		 windowFeatures=windowFeatures +"left=" + winLeft + ",";
		 windowFeatures=windowFeatures + "top=" + winTop;
 		 var farmpicswindow=window.open(showpic,"farmpicswindow",windowFeatures);
		 farmpicswindow.focus();
		 return false;
		 }

		 

/***********************************************
* Disable "Enter" key in Form script- By Nurul Fadilah(nurul@REMOVETHISvolmedia.com)
* This notice must stay intact for use
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/
                
function handleEnter (field, event) {
		var keyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode;
		if (keyCode == 13) {
			var i;
			for (i = 0; i < field.form.elements.length; i++)
				if (field == field.form.elements[i])
					break;
			i = (i + 1) % field.form.elements.length;
			field.form.elements[i].focus();
			return false;
		} 
		else
		return true;
	}      

/****************TO PUT IN THE DATE*/
function myDate() {
today=new Date();
today.setDate(today.getDate()-3);
day=today.getDate();
year=today.getFullYear();
month=today.getMonth()+1;
if (day==1) end=("st");
else if (day==2) end=("nd");
else if (day==3) end=("rd");
else if (day==21) end=("st");
else if (day==22) end=("nd");
else if (day==23) end=("rd");
else if (day==31) end=("st");
else end=("th");
if (month==1) cname=("January");
else if (month==2) cname=("February");
else if (month==3) cname=("March");
else if (month==4) cname=("April");
else if (month==5) cname=("May");
else if (month==6) cname=("June");
else if (month==7) cname=("July");
else if (month==8) cname=("August");
else if (month==9) cname=("September");
else if (month==10) cname=("October");
else if (month==11) cname=("November");
else cname=("December");
/*if (year<100) year="19" + year;*/
document.write(cname + " " + day + end + ", " + year);
}


