<!-- ;
var newwindow;
var wheight = 0, wwidth = 0;
function popitup5(url, title, iwidth, iheight, colour, caption) {
var pwidth, pheight;
var NewCaption = caption;

NewCaption = NewCaption.replace(/#APOSTROPHE#/,"'");
NewCaption = NewCaption.replace(/#APOSTROPHE#/,"'");
NewCaption = NewCaption.replace(/#QUOTE#/,"&quot;");
NewCaption = NewCaption.replace(/#QUOTE#/,"&quot;");

if ( !newwindow || newwindow.closed ) {
pwidth=iwidth+30;
pheight=iheight+40;
newwindow=window.open('','htmlname','width=' + pwidth +',height=' + pheight + ',resizable=0,top=50,left=10');
wheight=iheight;
wwidth=iwidth;
}

if (wheight!=iheight || wwidth!=iwidth ) {
pwidth=iwidth+30;
pheight=iheight+80;
newwindow.resizeTo(pwidth, pheight);
wheight=iheight;
wwidth=iwidth;
}

newwindow.document.clear();
newwindow.focus();
newwindow.document.writeln('<html> <head> <title>' + title + '<\/title> <\/head>');
newwindow.document.writeln('<body bgcolor= \"' + colour + '\" style="margin:5px;width:' + (pwidth - 10) + 'px;">');
newwindow.document.writeln('<div align="center">');
newwindow.document.writeln('<table border="0" cellpadding="0" cellspacing="0">');
newwindow.document.writeln('<tr><td align="center">');
newwindow.document.writeln('<img border="1" bordercolour="#333333" src=' + url + '>');
newwindow.document.writeln('</td></tr><tr><td>');
newwindow.document.writeln('<p align="center"><b><font face="arial" size="2">' + NewCaption + '</font></b></p>');
newwindow.document.writeln('</td></tr></table><\/div> <\/body> <\/html>');
newwindow.document.close();
newwindow.focus();
}


// Routines to tidy up popup windows when page is left
// Call with an onUnload="tidy5()" in body tag


function tidy5() {
if (newwindow && !newwindow.closed) { newwindow.close(); }
}

function closeWindow(theURL) { 
  window.close(theURL);
}

function ConfirmChoice(Question,Target) 
  { 
  answer = confirm(Question)
  if (answer !=0) 
    {   
    window.location = Target
    } 
  }
  
function InputText(Question,Target,Default) 
  { 
  answer = prompt(Question,Default)
  if (answer != null) 
    {   
    window.location = Target + escape(answer)
    } 
  }
  
function winopen(PageURL){
	window.open(PageURL, 'NewWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=yes,width=420,height=350,left=10,top=10')

}

function OpenPopUp(PageURL, ScrollBars, Resizable, WindowWidth, WindowHeight){
  window.open(PageURL, 'NewWindow','toolbar=yes,location=no,directories=no,status=no,menubar=no,scrollbars=' + ScrollBars + ',resizable=' + Resizable + ',copyhistory=yes,width=' + WindowWidth + ',height=' + WindowHeight)
}

function OpenPopUp2(PageURL, ScrollBars, Resizable, WindowWidth, WindowHeight, Toolbar)
	{
	//center window in screen
	var ScreenWidth  = screen.width;
	var ScreenHeight = screen.height;
	var PopUpLeft    = (ScreenWidth  - WindowWidth)  / 2;
	var PopUpTop     = (ScreenHeight - WindowHeight) / 2;
  window.open(PageURL, 'NewWindow','toolbar=' + Toolbar + ',location=no,directories=no,status=no,menubar=no,scrollbars=' + ScrollBars + ',resizable=' + Resizable + ',copyhistory=yes,width=' + WindowWidth + ',height=' + WindowHeight + ',left=' + PopUpLeft + ',top=' + PopUpTop);
	}

function hide(){document.getElementById('NewsLayer').style.visibility="hidden";}
	
function jah(url,target) {

// native XMLHttpRequest object
// document.getElementById(target).innerHTML = 'sending...';
    if (window.XMLHttpRequest) {
        req = new XMLHttpRequest();
        req.onreadystatechange = function() {jahDone(target);};
        req.open("GET", url, true);
        req.send(null);
    // IE/Windows ActiveX version
    } else if (window.ActiveXObject) {
        req = new ActiveXObject("Microsoft.XMLHTTP");
        if (req) {
            req.onreadystatechange = function() {jahDone(target);};
            req.open("GET", url, true);
            req.send();
        }
    }
} 
function jahDone(target) {
	// only if req is "loaded"
	if (req.readyState == 4) {
	// only if "OK"
	if (req.status == 200) {
		results = req.responseText;
		document.getElementById(target).innerHTML = results;
	} else {
		document.getElementById(target).innerHTML="jah error:\n" + req.statusText;
	}
	}
}

function getSel() {
  var txt = '';
  
  if (window.getSelection) {
    txt = window.getSelection();
    }
  else if (document.getSelection) {
    txt = document.getSelection();
    }
  else if (document.selection) {
    txt = document.selection.createRange().text;
    }
  else return;
  
  alert(txt);
}

<!--

// Browser sniffer. Written by PerlScriptsJavaScripts.com

v3 = 0; op = 0; ie4  = 0; ie5 = 0; nn4 = 0; nn6 = 0; 
isMac = 0; aol = 0;

if(document.images){
    if(navigator.userAgent.indexOf("Opera") != -1){
        op = 1;
    } else {
        if(navigator.userAgent.indexOf("AOL") != -1){
            aol = 1;
        } else {
            ie4 = (document.all && !document.getElementById);
            nn4 = (document.layers);
            ie5 = (document.all && document.getElementById);
            nn6 = (document.addEventListener);
        }
    }
} else {
    v3 = 1;	
}

if(navigator.userAgent.indexOf("Mac") != -1){
    isMac = 1;
}

// -->


 
function Left(str, n)
	{
	if (n <= 0)
	    return "";
	else if (n > String(str).length)
	    return str;
	else
	    return String(str).substring(0,n);
	}

function Right(str, n)
	{
    if (n <= 0)
       return "";
    else if (n > String(str).length)
       return str;
    else {
       var iLen = String(str).length;
       return String(str).substring(iLen, iLen - n);
    }
	}
	
function Mid(str, start, len)
{
// Make sure start and len are within proper bounds
    if (start < 0 || len < 0) return "";
    var iEnd, iLen = String(str).length;
    if (start + len > iLen)
          iEnd = iLen;
    else
          iEnd = start + len;
    return String(str).substring(start,iEnd);
}

function ShowHotels(StarRating,Others){
	var TmpArray = Others.split("|")
	var x
	for (x in TmpArray)
	{
		if(TmpArray[x]!=StarRating){
			document.getElementById('HotelListStar' + TmpArray[x]).style.display='none';
			document.getElementById('HotelListStar' + TmpArray[x]).style.visibility='hidden';
			document.getElementById('starbutton' + TmpArray[x]).style.background='none';
			document.getElementById('starlink' + TmpArray[x]).style.color='#0033FF';
			}
			else{
			document.getElementById('HotelListStar' + TmpArray[x]).style.display='block';
			document.getElementById('HotelListStar' + TmpArray[x]).style.visibility='visible';
			document.getElementById('starbutton' + TmpArray[x]).style.background='#0066FF';
			document.getElementById('starlink' + TmpArray[x]).style.color='#FFFFFF';
				}
		}
	}

//============================================================================================

function GetInsurancePrice(Duration, Age)
	{
		if (Age != 'Invalid Date Of Birth') {
			var InsurancePrice = 0;		
			if((parseInt(Duration)>=0)&&(parseInt(Duration)<=9))
				{
				if ((parseInt(Age)>=0)  && (parseInt(Age)<=17)) {InsurancePrice=9.50}
				if ((parseInt(Age)>=18) && (parseInt(Age)<=65)) {InsurancePrice=19}
				if ((parseInt(Age)>=66))                        {InsurancePrice='Over65'}
				}
			else if((parseInt(Duration)>=10)&&(parseInt(Duration)<=17))
				{
				if ((parseInt(Age)>=0)  && (parseInt(Age)<=17)) {InsurancePrice=11.25}
				if ((parseInt(Age)>=18) && (parseInt(Age)<=65)) {InsurancePrice=22.50}
				if ((parseInt(Age)>=66))                        {InsurancePrice='Over65'}
				}
			else if((parseInt(Duration)>=18)&&(parseInt(Duration)<=25))
				{
				if ((parseInt(Age)>=0)  && (parseInt(Age)<=17)) {InsurancePrice='Over65'}
				if ((parseInt(Age)>=18) && (parseInt(Age)<=65)) {InsurancePrice='Over65'}
				if ((parseInt(Age)>=66))                        {InsurancePrice='Over65'}
				}
			else if((parseInt(Duration)>=26)&&(parseInt(Duration)<=31))
				{
				if ((parseInt(Age)>=0)  && (parseInt(Age)<=17)) {InsurancePrice='Over65'}
				if ((parseInt(Age)>=18) && (parseInt(Age)<=65)) {InsurancePrice='Over65'}
				if ((parseInt(Age)>=66))                        {InsurancePrice='Over65'}
				}
			else
				{
				InsurancePrice = 'Over65';
				}
			return InsurancePrice;
		}
		else
		{
			return 'Invalid Date Of Birth';
		}
	}

//============================================================================================

var MONTH_NAMES=new Array('January','February','March','April','May','June','July','August','September','October','November','December','Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec');
var DAY_NAMES=new Array('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday','Sun','Mon','Tue','Wed','Thu','Fri','Sat');
function LZ(x) {return(x<0||x>9?"":"0")+x}

var dtCh= "-";
var minYear=1900;
var maxYear=2100;

function isInteger(s){
	var i;
    for (i = 0; i < s.length; i++){   
        // Check that current character is number.
        var c = s.charAt(i);
        if (((c < "0") || (c > "9"))) return false;
    }
    // All characters are numbers.
    return true;
}

function stripCharsInBag(s, bag){
	var i;
    var returnString = "";
    // Search through string's characters one by one.
    // If character is not in bag, append to returnString.
    for (i = 0; i < s.length; i++){   
        var c = s.charAt(i);
        if (bag.indexOf(c) == -1) returnString += c;
    }
    return returnString;
}

function daysInFebruary (year){
	// February has 29 days in any year evenly divisible by four,
    // EXCEPT for centurial years which are not also divisible by 400.
    return (((year % 4 == 0) && ( (!(year % 100 == 0)) || (year % 400 == 0))) ? 29 : 28 );
}
function DaysArray(n) {
	for (var i = 1; i <= n; i++) {
		this[i] = 31
		if (i==4 || i==6 || i==9 || i==11) {this[i] = 30}
		if (i==2) {this[i] = 29}
   } 
   return this
}

function isDate(dtStr){
	var daysInMonth = DaysArray(12)
	var pos1=dtStr.indexOf(dtCh)
	var pos2=dtStr.indexOf(dtCh,pos1+1)
	var strMonth=dtStr.substring(0,pos1)
	var strDay=dtStr.substring(pos1+1,pos2)
	var strYear=dtStr.substring(pos2+1)
	strYr=strYear
	if (strDay.charAt(0)=="0" && strDay.length>1) strDay=strDay.substring(1)
	if (strMonth.charAt(0)=="0" && strMonth.length>1) strMonth=strMonth.substring(1)
	for (var i = 1; i <= 3; i++) {
		if (strYr.charAt(0)=="0" && strYr.length>1) strYr=strYr.substring(1)
	}
	month=parseInt(strMonth)
	day=parseInt(strDay)
	year=parseInt(strYr)
	if (pos1==-1 || pos2==-1){
		//alert("The date format should be : mm/dd/yyyy")
		return false
	}
	if (strMonth.length<1 || month<1 || month>12){
		//alert("Please enter a valid month")
		return false
	}
	if (strDay.length<1 || day<1 || day>31 || (month==2 && day>daysInFebruary(year)) || day > daysInMonth[month]){
		//alert("Please enter a valid day")
		return false
	}
	if (strYear.length != 4 || year==0 || year<minYear || year>maxYear){
		//alert("Please enter a valid 4 digit year between "+minYear+" and "+maxYear)
		return false
	}
	if (dtStr.indexOf(dtCh,pos2+1)!=-1 || isInteger(stripCharsInBag(dtStr, dtCh))==false){
		alert("Please enter a valid date")
		return false
	}
return true
}

function compareDates(date1,dateformat1,date2,dateformat2) {
	var d1=getDateFromFormat(date1,dateformat1);
	var d2=getDateFromFormat(date2,dateformat2);
	if (d1==0 || d2==0) {
		return -1;
		}
	else if (d1 > d2) {
		return 1;
		}
	return 0;
	}

function formatDate(date,format) {
	format=format+"";
	var result="";
	var i_format=0;
	var c="";
	var token="";
	var y=date.getYear()+"";
	var M=date.getMonth()+1;
	var d=date.getDate();
	var E=date.getDay();
	var H=date.getHours();
	var m=date.getMinutes();
	var s=date.getSeconds();
	var yyyy,yy,MMM,MM,dd,hh,h,mm,ss,ampm,HH,H,KK,K,kk,k;
	// Convert real date parts into formatted versions
	var value=new Object();
	if (y.length < 4) {y=""+(y-0+1900);}
	value["y"]=""+y;
	value["yyyy"]=y;
	value["yy"]=y.substring(2,4);
	value["M"]=M;
	value["MM"]=LZ(M);
	value["MMM"]=MONTH_NAMES[M-1];
	value["NNN"]=MONTH_NAMES[M+11];
	value["d"]=d;
	value["dd"]=LZ(d);
	value["E"]=DAY_NAMES[E+7];
	value["EE"]=DAY_NAMES[E];
	value["H"]=H;
	value["HH"]=LZ(H);
	if (H==0){value["h"]=12;}
	else if (H>12){value["h"]=H-12;}
	else {value["h"]=H;}
	value["hh"]=LZ(value["h"]);
	if (H>11){value["K"]=H-12;} else {value["K"]=H;}
	value["k"]=H+1;
	value["KK"]=LZ(value["K"]);
	value["kk"]=LZ(value["k"]);
	if (H > 11) { value["a"]="PM"; }
	else { value["a"]="AM"; }
	value["m"]=m;
	value["mm"]=LZ(m);
	value["s"]=s;
	value["ss"]=LZ(s);
	while (i_format < format.length) {
		c=format.charAt(i_format);
		token="";
		while ((format.charAt(i_format)==c) && (i_format < format.length)) {
			token += format.charAt(i_format++);
			}
		if (value[token] != null) { result=result + value[token]; }
		else { result=result + token; }
		}
	return result;
	}
	
//============================================================================================

function _isInteger(val) {
	var digits="1234567890";
	for (var i=0; i < val.length; i++) {
		if (digits.indexOf(val.charAt(i))==-1) { return false; }
		}
	return true;
	}
	
//============================================================================================

function _getInt(str,i,minlength,maxlength) {
	for (var x=maxlength; x>=minlength; x--) {
		var token=str.substring(i,i+x);
		if (token.length < minlength) { return null; }
		if (_isInteger(token)) { return token; }
		}
	return null;
	}

//============================================================================================
	
function isDigit(theDigit) 
{ 
var digitArray = new Array('0','1','2','3','4','5','6','7','8','9'),j; 

for (j = 0; j < digitArray.length; j++) 
{if (theDigit == digitArray[j]) 
return true 
} 
return false 

} 

//============================================================================================

function isPositiveInteger(theString) 
{ 
var theData = new String(theString) 

if (!isDigit(theData.charAt(0))) 
if (!(theData.charAt(0)== '+')) 
return false 

for (var i = 1; i < theData.length; i++) 
if (!isDigit(theData.charAt(i))) 
return false 
return true 
} 

//============================================================================================

function dateDiff(p_Interval, p_Date1, p_Date2, p_firstdayofweek, p_firstweekofyear){
	if(!isDate(p_Date1)){return "invalid date: '" + p_Date1 + "'";}
	//if(!isDate(p_Date2)){return "invalid date: '" + p_Date2 + "'";}
	var dt1 = new Date(parseDate(p_Date1));
	var dt2 = new Date(p_Date2);

	// get ms between dates (UTC) and make into "difference" date
	var iDiffMS = dt2.valueOf() - dt1.valueOf();
	var dtDiff = new Date(iDiffMS);

	// calc various diffs
	var nYears  = dt2.getUTCFullYear() - dt1.getUTCFullYear();
	var nMonths = dt2.getUTCMonth() - dt1.getUTCMonth() + (nYears!=0 ? nYears*12 : 0);
	var nQuarters = parseInt(nMonths/3);	//<<-- different than VBScript, which watches rollover not completion
	
	var nMilliseconds = iDiffMS;
	var nSeconds = parseInt(iDiffMS/1000);
	var nMinutes = parseInt(nSeconds/60);
	var nHours = parseInt(nMinutes/60);
	var nDays  = parseInt(nHours/24);
	var nWeeks = parseInt(nDays/7);


	// return requested difference
	var iDiff = 0;		
	switch(p_Interval.toLowerCase()){
		case "yyyy": return nYears;
		case "q": return nQuarters;
		case "m": return nMonths;
		case "y": 		// day of year
		case "d": return nDays;
		case "w": return nDays;
		case "ww":return nWeeks;		// week of year	// <-- inaccurate, WW should count calendar weeks (# of sundays) between
		case "h": return nHours;
		case "n": return nMinutes;
		case "s": return nSeconds;
		case "ms":return nMilliseconds;	// millisecond	// <-- extension for JS, NOT available in VBScript
		default: return "invalid interval: '" + p_Interval + "'";
	}
}

//============================================================================================

function getDateFromFormat(val,format) {
	val=val+"";
	format=format+"";
	var i_val=0;
	var i_format=0;
	var c="";
	var token="";
	var token2="";
	var x,y;
	var now=new Date();
	var year=now.getYear();
	var month=now.getMonth()+1;
	var date=1;
	var hh=now.getHours();
	var mm=now.getMinutes();
	var ss=now.getSeconds();
	var ampm="";
	
	while (i_format < format.length) {
		// Get next token from format string
		c=format.charAt(i_format);
		token="";
		while ((format.charAt(i_format)==c) && (i_format < format.length)) {
			token += format.charAt(i_format++);
			}
		// Extract contents of value based on format token
		if (token=="yyyy" || token=="yy" || token=="y") {
			if (token=="yyyy") { x=4;y=4; }
			if (token=="yy")   { x=2;y=2; }
			if (token=="y")    { x=2;y=4; }
			year=_getInt(val,i_val,x,y);
			if (year==null) { return 0; }
			i_val += year.length;
			if (year.length==2) {
				if (year > 70) { year=1900+(year-0); }
				else { year=2000+(year-0); }
				}
			}
		else if (token=="MMM"||token=="NNN"){
			month=0;
			for (var i=0; i<MONTH_NAMES.length; i++) {
				var month_name=MONTH_NAMES[i];
				if (val.substring(i_val,i_val+month_name.length).toLowerCase()==month_name.toLowerCase()) {
					if (token=="MMM"||(token=="NNN"&&i>11)) {
						month=i+1;
						if (month>12) { month -= 12; }
						i_val += month_name.length;
						break;
						}
					}
				}
			if ((month < 1)||(month>12)){return 0;}
			}
		else if (token=="EE"||token=="E"){
			for (var i=0; i<DAY_NAMES.length; i++) {
				var day_name=DAY_NAMES[i];
				if (val.substring(i_val,i_val+day_name.length).toLowerCase()==day_name.toLowerCase()) {
					i_val += day_name.length;
					break;
					}
				}
			}
		else if (token=="MM"||token=="M") {
			month=_getInt(val,i_val,token.length,2);
			if(month==null||(month<1)||(month>12)){return 0;}
			i_val+=month.length;}
		else if (token=="dd"||token=="d") {
			date=_getInt(val,i_val,token.length,2);
			if(date==null||(date<1)||(date>31)){return 0;}
			i_val+=date.length;}
		else if (token=="hh"||token=="h") {
			hh=_getInt(val,i_val,token.length,2);
			if(hh==null||(hh<1)||(hh>12)){return 0;}
			i_val+=hh.length;}
		else if (token=="HH"||token=="H") {
			hh=_getInt(val,i_val,token.length,2);
			if(hh==null||(hh<0)||(hh>23)){return 0;}
			i_val+=hh.length;}
		else if (token=="KK"||token=="K") {
			hh=_getInt(val,i_val,token.length,2);
			if(hh==null||(hh<0)||(hh>11)){return 0;}
			i_val+=hh.length;}
		else if (token=="kk"||token=="k") {
			hh=_getInt(val,i_val,token.length,2);
			if(hh==null||(hh<1)||(hh>24)){return 0;}
			i_val+=hh.length;hh--;}
		else if (token=="mm"||token=="m") {
			mm=_getInt(val,i_val,token.length,2);
			if(mm==null||(mm<0)||(mm>59)){return 0;}
			i_val+=mm.length;}
		else if (token=="ss"||token=="s") {
			ss=_getInt(val,i_val,token.length,2);
			if(ss==null||(ss<0)||(ss>59)){return 0;}
			i_val+=ss.length;}
		else if (token=="a") {
			if (val.substring(i_val,i_val+2).toLowerCase()=="am") {ampm="AM";}
			else if (val.substring(i_val,i_val+2).toLowerCase()=="pm") {ampm="PM";}
			else {return 0;}
			i_val+=2;}
		else {
			if (val.substring(i_val,i_val+token.length)!=token) {return 0;}
			else {i_val+=token.length;}
			}
		}
	// If there are any trailing characters left in the value, it doesn't match
	if (i_val != val.length) { return 0; }
	// Is date valid for month?
	if (month==2) {
		// Check for leap year
		if ( ( (year%4==0)&&(year%100 != 0) ) || (year%400==0) ) { // leap year
			if (date > 29){ return 0; }
			}
		else { if (date > 28) { return 0; } }
		}
	if ((month==4)||(month==6)||(month==9)||(month==11)) {
		if (date > 30) { return 0; }
		}
	// Correct hours value
	if (hh<12 && ampm=="PM") { hh=hh-0+12; }
	else if (hh>11 && ampm=="AM") { hh-=12; }
	var newdate=new Date(year,month-1,date,hh,mm,ss);
	return newdate.getTime();
	}

//============================================================================================

function parseDate(val) {
	if (val != '-----')
		{
		var preferEuro=(arguments.length==2)?arguments[1]:false;
		generalFormats=new Array('y-M-d','MMM d, y','MMM d,y','y-MMM-d','d-MMM-y','MMM d');
		monthFirst=new Array('M/d/y','M-d-y','M.d.y','MMM-d','M/d','M-d');
		dateFirst =new Array('d/M/y','d-M-y','d.M.y','d-MMM','d/M','d-M');
		var checkList=new Array('generalFormats',preferEuro?'dateFirst':'monthFirst',preferEuro?'monthFirst':'dateFirst');
		var d=null;
		for (var i=0; i<checkList.length; i++) {
			var l=window[checkList[i]];
			for (var j=0; j<l.length; j++) {
				d=getDateFromFormat(val,l[j]);
				if (d!=0) { return new Date(d); }
				}
			}
		return null;
		}
	else {return null;}
	}
	
//============================================================================================

function dateAddExtention(p_Interval, p_Number){
   var thing = new String();
   //in the spirt of VB we'll make this function non-case sensitive
   //and convert the charcters for the coder.
   p_Interval = p_Interval.toLowerCase();
   if(isNaN(p_Number)){
      //Only accpets numbers 
      //throws an error so that the coder can see why he effed up   
      throw "The second parameter must be a number. \n You passed: " + p_Number;
      return false;
   }
   p_Number = new Number(p_Number);
   switch(p_Interval.toLowerCase()){
      case "yyyy": {// year
         this.setFullYear(this.getFullYear() + p_Number);
         break;
      }
      case "q": {      // quarter
         this.setMonth(this.getMonth() + (p_Number*3));
         break;
      }
      case "m": {      // month
         this.setMonth(this.getMonth() + p_Number);
         break;
      }
      case "y":      // day of year
      case "d":      // day
      case "w": {      // weekday
         this.setDate(this.getDate() + p_Number);
         break;
      }
      case "ww": {   // week of year
         this.setDate(this.getDate() + (p_Number*7));
         break;
      }
      case "h": {      // hour
         this.setHours(this.getHours() + p_Number);
         break;
      }
      case "n": {      // minute
         this.setMinutes(this.getMinutes() + p_Number);
         break;
      }
      case "s": {      // second
         this.setSeconds(this.getSeconds() + p_Number);
         break;
      }
      case "ms": {      // second
         this.setMilliseconds(this.getMilliseconds() + p_Number);
         break;
      }
      default: {
         //throws an error so that the coder can see why he effed up and
         //a list of elegible letters.
         throw   "The first parameter must be a string from this list: \n" +
               "yyyy, q, m, y, d, w, ww, h, n, s, or ms.  You passed: " + p_Interval;
         return false;
      }
   }
   return this;
}
Date.prototype.dateAdd = dateAddExtention; 

function isNumberKey(evt)
{
	 var charCode = (evt.which) ? evt.which : event.keyCode
	 if ((charCode > 31) && (charCode < 48 || charCode > 57) && (charCode!=46))
			return false;

	 return true;
}

function ReplaceMap(CountryName,SelectedCell)
	{
	document.getElementById('DestinationMap').src='images/map/'+CountryName+'_right.jpg';
	SelectedCell.style.color = "#FF9B01"
	}
	
function ResetMap(SelectedCell)
	{
	document.getElementById('DestinationMap').src='images/map/none_right.jpg';
	SelectedCell.style.color = "#FFFFFF"
	}

function SwitchSearchMode(SwitchTo)
	{
	var ParentLocation = String(window.parent.location);
	ParentLocation = ParentLocation.replace('&SM=A','')
	ParentLocation = ParentLocation.replace('&SM=Q','')
	ParentLocation = ParentLocation.replace('?SM=A','')
	ParentLocation = ParentLocation.replace('?SM=Q','')
	//alert(ParentLocation.indexOf('?'));
	if(SwitchTo=='advanced')
		{
		if(ParentLocation.indexOf('?')>0)
			{
			window.parent.location = ParentLocation + '&SM=A';
			}
		else
			{
			window.parent.location = ParentLocation + '?SM=A';
			}
		}
	else
		{
		if(ParentLocation.indexOf('?')>0)
			{
			window.parent.location = ParentLocation + '&SM=Q';
			}
		else
			{
			window.parent.location = ParentLocation + '?SM=Q';
			}
		}
	}
	
function trim(stringToTrim) {
	return stringToTrim.replace(/^\s+|\s+$/g,"");
	}
function ltrim(stringToTrim) {
	return stringToTrim.replace(/^\s+/,"");
	}
function rtrim(stringToTrim) {
	return stringToTrim.replace(/\s+$/,"");
	}