function externalLinks(){
	for (var i=0; (a=document.getElementsByTagName('a')[i]);i++) {
		if (a.getAttribute("rel") == "external")
			a.target = "_blank";
	}
}
function setOpacity(e,op) {
	if(typeof e == "string")
		var x = $(e);
	else if(typeof e == "object")
		var x = e;
	if (!x) return;
	op = (op == 100)?99.999:op;
	// ie/Win
	x.style.filter = "alpha(opacity:"+op+")";
	// Safari<1.2, Konqueror
	x.style.KHTMLopacity = op/100;
	// Older mozilla and Firefox
	x.style.Mozopacity = op/100;
	// Safari 1.2, newer Firefox and mozilla, CSS3
	x.style.opacity = op/100;
}

function clearSearchBox(){
	var s = $('searchBox');
	if (typeof s == 'object')
		s.onfocus = function(){this.value='';}
}

function changeFontSize(){
	var i = $('incF');
	var d = $('decF');
	var s=readCookie('bc');
	
	if (!s)
		createCookie('bc', 2);
	else 
		setBodyClass(s);
	
	if(!i || !d) return;
	
	i.onclick = function() {
		var s = readCookie('bc');
		if(s==1 || s==2){
			var x=s-(-1);
			setBodyClass(x);
			createCookie('bc',x);
		}
		return false;
	};
	
	d.onclick = function (){
		var s = readCookie('bc');
		if(s==2 || s==3){
			var x=s-1;
			setBodyClass(x);
			createCookie('bc',x);
		}
		return false;
	}
	
}
function setBodyClass(lvl){
	var a=new Array(0,'small','','big');
	document.getElementsByTagName('body')[0].className=a[lvl];
}

function navigation()
{
	var nav = $('navigation');
	if (!nav) return;

	for (var i=0; (l=$('navigation').getElementsByTagName('li')[i]); i++)
	{
		l.onmouseover = function(){
			if (Element.hasClassName(this,'parent'))
				Element.addClassName(this,'over');
		};
		l.onmouseout = function() {
			Element.removeClassName(this,'over');
		}
	}
}

function webcamUpdate(){
	var img = $('camimg');
	if (!img) return;
	
	var cam = {
		src	: img.getAttribute('src')
	};

	cam.update=function(){
		$('camimg').src = cam.src + '?' + (new Date()*1);
	}
	new PeriodicalExecuter(cam.update, 10);
}



function ShowCurrentImage(imageName)
	{
	
		var thumb = document.getElementById("mainThumbArea");
		var divloading = document.getElementById("divloading"); 
		var divchild = document.getElementById("childslid"); 

			 thumb.src = imageName;		
		

			 thumb.onreadystatechange = function() { 										
				       
		  	if(thumb.readyState!="complete")								
			{					
				divloading.style.visibility = 'visible';								
				divloading.className = "cropImageArea";				
				divchild.style.visibility = 'hidden';				
			}
	   else if(thumb.readyState=="complete")
            {					
				divloading.style.visibility = 'hidden';				
				divchild.style.visibility = 'visible';		
				divchild.style.position = 'relative';
				divchild.className = "cropImageArea";				
			}       

	};											
		
		
	}


function slideshow() {
	if(!$('slideshow'))return;
	if (document.getElementsByTagName) {
	 var popupLinks = document.getElementsByTagName("a");
	 var slideshowImages = new Array();
	
	 for (i = 0; i < popupLinks.length; i++) {
		 if (popupLinks[i].className == "thumbnail_slideshow hidden") {
		 	slideshowImages.push(popupLinks[i].href);
		 }
	 }
	}
	
	var be = $('sse');
	var bn = $('ssn');
	var bp = $('ssp');
	var cs = $('ssc').firstChild;
	var thumb = document.getElementById("mainThumbArea");
	var divloading = document.getElementById("divloading"); 
	var divchild = document.getElementById("childslid"); 
	//var divchild2 = document.getElementById("divChild2");
	var temp ;
	var theSrc;
	
	bn.onclick = function(e){	
		
		
		temp = thumb.src.split('=');
		temp = temp[1];
		//alert(temp);

		temp++;
		if(temp >= slideshowImages.length){
			temp = 0;
		}
		
	
		document.getElementById("hdnId").value= parseInt(temp) + 1;

		thumb.src = slideshowImages[temp]+"?n="+temp;		

   			cs.nodeValue=++temp;	
	 	    stoplink(e);


		

if(navigator.appName =='Microsoft Internet Explorer')
	{ 	
	
 	 
	 thumb.onreadystatechange = function() { 				 

  	 if(thumb.readyState!="complete")								
			{					
				divloading.style.visibility = 'visible';								
				divloading.className = "cropImageArea";
				//divchild.className = "";
				divchild.style.visibility = 'hidden';
				//divchild.style.position = 'absolute';
				
				//Loading Please Wait............
				//divloading.innerHTML = "Loading image please wait....";								
			}
	   else if(thumb.readyState=="complete")
            {					
				divloading.style.visibility = 'hidden';
				//divloading.className = "";
				divchild.style.visibility = 'visible';		
				divchild.style.position = 'relative';
				divchild.className = "cropImageArea";			
				
			}           		

		};																		   
	}
		
		    

		  
		  
	}

	
	bp.onclick = function(e){
		temp = thumb.src.split('=');
		temp = temp[1];
		temp--;
		if(temp < 0){
			temp = slideshowImages.length;
			temp--;
		}
		thumb.src = slideshowImages[temp]+"?n="+temp;
		
		document.getElementById("hdnId").value= parseInt(temp) + 1;
		
		cs.nodeValue=++temp;
		stoplink(e);
	}	

	  be.onclick = theSlideShow;
	//  be.onclick = theSlideShow2;	

	return;
	
	if(!$('slideshow'))return;
	var s = {
		con	:	$('slideshow'),
		cur	:	0,
		cs	:	$('ssc').firstChild,	//counter
		ts	:	$('sst').firstChild,	//title
		bn	:	$('ssn'),	//next
		bp	:	$('ssp'),	//previous
		be	:	$('sse')	//enlarge
	};
	s.sl=s.con.getElementsByTagName('img');
	if(s.sl.length==0)return;

	s.move=function(n){
		
		for(var i=0;i<s.sl.length;i++)
			Element.addClassName(s.sl[i],'h');
			
		//var fpath=APP_URI+'images/locations/fullsize/';
		var fpath='/images/locations/hires/';
		var x=s.sl[s.cur].getAttribute('src').split('/');
		var fname=x[x.length-1];
		s.fi = new Image();
		s.fi.src = fpath+fname;
		mySetAttribute(s.be,'href', fpath+fname);
		Element.removeClassName(s.sl[s.cur],'h');
		s.cs.nodeValue=s.cur+1;
		s.ts.nodeValue=s.sl[s.cur].alt;
	}

	s.bn.onclick=function(e){
		s.cur=((s.cur+1)>=s.sl.length?0:(s.cur+1));
		s.move();
		stoplink(e);
	};
	
	s.bp.onclick=function(e){
		s.cur=((s.cur-1)<0?s.sl.length-1:(s.cur-1));
		s.move();
		stoplink(e);
	};

	s.be.onclick = function(e) {
		showIndicator();
		stoplink(e);
		
		var im = new Image();
		im.id="bigImage";
		im.src=this.getAttribute('href');
		im.alt=s.sl[s.cur].getAttribute('alt');
		im.title="Click to close [x]";		
							
		if ($('popunder')) 
			Element.remove($('popunder'));
		var pu = document.createElement('div');
		mySetAttribute(pu,'id','popunder');

		var a=document.createElement('a');
		mySetAttribute(a,'href','#');
		
		a.onclick = function(e){
			Element.remove(pu);stoplink(e);
		}

		var cl=document.createElement('a');
		mySetAttribute(cl,'href',"#");
		mySetAttribute(cl,'id',"img_close");
		cl.appendChild(document.createTextNode('Close this image [x]'));
		cl.onclick=function(e){
			Element.remove(this.parentNode);
			stoplink(e)
		};

		var bn=document.createElement('a');
		mySetAttribute(bn,'href',"#");
		mySetAttribute(bn,'id',"next_button");
		bn.appendChild(document.createTextNode('Next >>'));
		bn.onclick=function(e){
			s.cur=((s.cur+1)>=s.sl.length?0:(s.cur+1));
			setNewBigImage(s,im,pu,off);
			stoplink(e);
		};
		
		var bp=document.createElement('a');
		mySetAttribute(bp,'href',"#");
		mySetAttribute(bp,'id',"prev_button");
		bp.appendChild(document.createTextNode('<< Prev'));
		bp.onclick=function(e){
			s.cur=((s.cur-1)<0?s.sl.length-1:(s.cur-1));
			setNewBigImage(s,im,pu,off);
			stoplink(e);
		};		

	
		var off=0;
		// only do this for ie
		if(typeof(document.media)=='string'){
			// scrolling offset calculation via www.quirksmode.org
			if (self.pageYOffset){off = self.pageYOffset;}
			else if (document.documentElement && document.documentElement.scrollTop) {off = document.documentElement.scrollTop; }
			else if (document.body) {off = document.body.scrollTop; }
		}


		var x=s.fi.width;
		var y=s.fi.height;
		mySetAttribute(im,'width',x);
		mySetAttribute(im,'height',y);
		pu.style.width=x+"px";

		//There used to be a cl.height here but ie has problems with
		//it so we just sort of guess the height - 25
		pu.style.height=y+25+"px";
		pu.style.marginLeft=-(x/2)+"px";
		pu.style.marginTop=-(y/2)+off+"px";
		a.appendChild(im);
		pu.appendChild(bp);
		pu.appendChild(bn);		
		pu.appendChild(cl);
		pu.appendChild(a);
		document.getElementsByTagName('body')[0].appendChild(pu);
		
		
		removeIndicator();
		document.getElementById("popunder").style.display = "block";			
				
		//a.focus();
		stoplink(e);
		
		s.move(s.cur+1);
	}
	

	//preload image
	s.move(0); 	
}

function setNewBigImage(s,im,pu,off){
	s.move();
	var x=s.fi.width;
	var y=s.fi.height;
	mySetAttribute(im,'width',x);
	mySetAttribute(im,'height',y);			
	mySetAttribute(im,'src',s.be.getAttribute('href'));
	pu.style.width=x+"px";
	
	//There used to be a cl.height here but ie has problems with
	//it so we just sort of guess the height
	pu.style.height=y+25+"px";
	pu.style.marginLeft=-(x/2)+"px";
	pu.style.marginTop=-(y/2)+off+"px";		
}

function details(){var con=$('infos');if(!con)return;var o={},s={};var g=function(n){var c=n.parentNode.nextSibling;return c.nodeName!="DD"?c.nextSibling:c;};for(var i=0;(a=con.getElementsByTagName('a')[i]);i++){if(a.parentNode.nodeName!='DT')continue;var dd=g(a);var idd=dd.getAttribute('id');var ob="o."+idd;var os="s."+idd;eval(ob+'=new fx.Height(dd,{duration: 400});'+ob+'.hide();'+os+'=false;');a.onclick=function(e){var id=g(this).id;for(var i in o){if(typeof eval('o.'+i)!='function'&&i!=id){eval("if(s."+i+"){s."+i+"=false;o."+i+".toggle();}");}}eval('o.'+id+'.toggle();s.'+id+'=!s.'+id+';');stoplink(e);};}}

function comparison(){
	var r=null;//requester
	var con=null;
	
	var trigg=document.getElementsByClassName('comp');
	for(var i=0;(comp=trigg[i]);i++){
	
		var a=comp.getElementsByTagName('a')[0];
		if (!a) continue;
		a.onclick=function(e){

			if ($('comparison_content'))
				Element.remove($('comparison_content'));

			con=document.createElement('div');
			mySetAttribute(con,'id','comparison_content');
		
			var cl=document.createElement('a');
			mySetAttribute(cl,'href',"#");
			mySetAttribute(cl,'id',"compare_close");
			cl.appendChild(document.createTextNode('Close this comparison [x]'));
			cl.onclick=function(e){
				Element.remove(this.parentNode);
				stoplink(e)
			};
			
			// only do this for ie
			if(typeof(document.media)=='string'){
				var off=0;
				// scrolling offset calculation via www.quirksmode.org
				if (self.pageYOffset){off = self.pageYOffset;}
				else if (document.documentElement && document.documentElement.scrollTop) {off = document.documentElement.scrollTop; }
				else if (document.body) {off = document.body.scrollTop; }
				con.style.top=200+off;	
			}
			
			con.appendChild(cl);

			fetch(this.id);
			
			document.getElementsByTagName('body')[0].appendChild(con);
			stoplink(e);
		};
	}	
	
	var fetch=function(id){
		
		var T=id.substring(8,11).split('v');
		//alert(T[0] + " " + T[1]);
		var url = APP_URI + 'compare.php';
		var pars = 't1='+escape(T[0])+'&t2='+escape(T[1]);
		var target = 'comwrap';
		var myAjax = new Ajax.Request(url, {method: 'get', parameters: pars,onComplete:voodoo});
	}
	
	var voodoo=function(obj){
		var w=document.createElement('div');
		w.setAttribute('id','comwrap');
		con.appendChild(w);
		w.innerHTML=obj.responseText;
	}
}

function updateCost(){
	var numPeople = document.getElementById('num_passengers').value;
	var theWeightCharge = document.getElementById('weight_charge').value;
	var origCost = document.getElementById('original_cost').value;
	var comfortRowVis = document.getElementById('comfortRow');
	var totalCost = document.getElementById('totalCostArea');
	var totalCost_details = document.getElementById('totalCostArea_details');
	var comfortCost_details = document.getElementById('comfortCost_details');
	var comfortAreaVis_details = document.getElementById('comfortArea_details');
	var numComfort = 0;
	var newTotal = 0;
	
	for(var i=0;i<numPeople;i++){
		if(document.getElementById('personWeight_'+ i).value >= 250){
			numComfort++;
		}
	}
	
	var totalComfort = Math.round(theWeightCharge*numComfort*100)/100;

	//Increment the total cost
	newTotal = Math.round((parseFloat(origCost)+totalComfort)*100)/100;
	totalCost.innerHTML = newTotal;
	totalCost_details.innerHTML = newTotal;

	//Whether or not we show a comfort charge	
	if(totalComfort > 0){
		comfortRowVis.className = 'comfortRowOn';
		comfortAreaVis_details.className = 'comfortAreaDetailsOn';
	} else {
		comfortRowVis.className = 'comfortRowOff';
		comfortAreaVis_details.className = 'comfortAreaDetailsOff';
	}
	
	
	document.getElementById('comfortSeat').innerHTML = "$ " + totalComfort;
	comfortCost_details.innerHTML = totalComfort;
}

function datePicker(){
	//if(!$('daSel'))return;
	Calendar.setup({
		inputField     :    "date",     // id of the input field
		ifFormat       :    "%m/%d/%Y",      // format of the input field
		button         :    "daSel",  // trigger for the calendar (button ID)
		align          :    "Br",           // alignment (defaults to "Bl")
		singleClick    :    true,
		range		   :	[2005,2007],
		weekNumbers : false
	});
}

function vacationDatePicker(){
	if(!$('vdp1') || !$('vdp2'))return;
	Calendar.setup({
		inputField     :    "vacdate1",     // id of the input field
		ifFormat       :    "%m/%d/%Y",      // format of the input field
		button         :    "vdp1",  // trigger for the calendar (button ID)
		align          :    "Br",           // alignment (defaults to "Bl")
		singleClick    :    true,
		range		   :	[2005,2006],
		weekNumbers : false
	});

	Calendar.setup({
		inputField     :    "vacdate2",     // id of the input field
		ifFormat       :    "%m/%d/%Y",      // format of the input field
		button         :    "vdp2",  // trigger for the calendar (button ID)
		align          :    "Br",           // alignment (defaults to "Bl")
		singleClick    :    true,
		range		   :	[2005,2006],
		weekNumbers : false
	});
}

function homeLinks(){
	var c=document.getElementsByClassName('av')[0];
	if(!c)return;
	for(var i=0;(l=c.getElementsByTagName('li')[i]);i++){
		if (l.getElementsByTagName('a')[0])
		{
			l.style.cursor="pointer";
			l.onmouseover=function(){
				window.status=this.getElementsByTagName('a')[0].href;
			}
			l.onmouseout=function(){
				window.status='';
			}
			l.onclick=function(){
				window.location=this.getElementsByTagName('a')[0].href;
			}
		}
	}
}

function validateStep1(){
	var f=$('tourBook1');
	if(!f)return;
	f.onsubmit=function(){
		var h=new Array(), t=new Array,d;
		for(var i=0;(inp=this.getElementsByTagName('input')[i]);i++) {
			if(inp.name=="helicopter" && inp.type!='hidden')
				h[h.length]=inp;
			if(inp.name=="time")
				t[t.length]=inp;
			if(inp.name=="date")
				d=inp;
		}
		//clear all errors before rechecking the form
		clearErrors(this);
		var flag = true;
		if(h.length > 1 && !_vHelicopters(h))
			flag=false;
		if(!_vDate(d))
			flag=false;
		if(!_vTime(t))
			flag=false;
		
		return flag;
	}
	
	//validate date
	function _vDate(d){
		var t=d.parentNode.parentNode;
		if ($F(d)=="") {
			regError(t,'Please provide a date',1);
			return false;
		}

		if (!validateDate($F(d))) {
			regError(t,'Invalid date format',1);
			return false;
		}
		
		var s=$F(d);
		var myDate = new Date();
		var now=new Date()
		now = now.getTime();
		myDate.setYear(parseInt(s.substring(6,10)));
		myDate.setMonth(parseInt(s.substring(0,2)-1));
		myDate.setDate(parseInt(s.substring(3,5)));
		myDate.setDate(myDate.getDate()-3);
		var checkDate=myDate.getTime();
		if (checkDate < now) {
			regError(t,'Please choose a date at least three days in advance.',1);
			return false;
		}
		return true;
	}
	
	//validate helipocopter
	function _vHelicopters(a) {
		var f=false;
		for(var i=0;i<a.length;i++){
			if (a[i].checked==true) {f=true;}
		}
		if (!f){
			regError(a[0].parentNode.parentNode.parentNode,"Choose helicopter",1);
		}
		return f;
	}
	//validate departure time
	function _vTime(a) {
		var f=false;
		for(var i=0;i<a.length;i++){
			if (a[i].checked==true) {f=true;}
		}
		if (!f){
			regError(a[0].parentNode.parentNode.parentNode,"Choose departure time",1);
			return false;
		}
		return true;
	}
}

//clear errors
function clearErrors(f) {
	var err = document.getElementsByClassName('err');
	for (var i=0;i<err.length;i++) {
		Element.remove(err[i]);
	}
}

//register error for booking form
function regError(e,msg,mode) {
	//mode:1 - tr , 2 - strong
	var txt = document.createTextNode(msg);
	switch(mode){
		case 1:
			var con=document.createElement('tr');
			var td=document.createElement('td');
			var s=document.createElement('strong');
			mySetAttribute(td,'colspan',2);
			s.appendChild(txt);
			td.appendChild(s);
			con.appendChild(td);
		break;
		
		case 2:
			var con=document.createElement('strong');
			con.appendChild(txt);
		break;
	}
	
	Element.addClassName(con,"err");
	e.parentNode.insertBefore(con,e);
}

function validateDate(d){
	var reg = /(01|02|03|04|05|06|07|08|09|10|11|12)\/(01|02|03|04|05|06|07|08|09|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31)\/(2005|2006|2007)/;
	return reg.test(d);
}

//step 2 validation
function validateStep2(){
	var f = $('tourBook2');
	if(!f)return;
	f.onsubmit=function(){
		var flag=true;
		
		clearErrors(this);
		if(_cancelForm()){
			flag=true;
		} else {
			if(!_vPassengers())
				flag=false;
			if(!_vClientName())
				flag=false;
			if(!_vClientPhone())
				flag=false;
			if(!_vClientEmail())
				flag=false;
			if(!_vTravelDates())
				flag=false;
			if(!_vTravelAccommodation())
				flag=false;
			if(!_vTravelCell())
				flag=false;			
		}
		return flag;
	}
	
	function _cancelForm(){
		if($F('resetForm')){
			return true;
		}
		return false;
	}
	
	function _vClientName(){
		if($F('firstName')=="" || $F('lastName')=="") {
			regError($('firstName').parentNode,'Please provide your name',2);
			return false;
		}
		return true;
	}
	
	function _vClientPhone(){
		if($F('phone')=="") {
			regError($('phone').parentNode,'Please provide your phone number',2);
			return false;
		}
		return true;
	}
	
	function _vTravelAccommodation(){
		if($F('accommodation')=="") {
			regError($('accommodation').parentNode,'Please provide your place of accommodation during your vacation',2);
			return false;
		}
		return true;
	}	
	
	function _vTravelCell(){
		if($F('cellphone')=="") {
			regError($('cellphone').parentNode,'Please provide your cellphone, so that we can contact you',2);
			return false;
		}
		return true;
	}	
	
	function _vClientEmail(){
		var e1=$F('email'),e2=$F('emailConfirm');
		if(e1==""){
			regError($('email').parentNode,'Please provide your email address',2);
			return false;
		}
		else if(!validateEmail(e1)) {
			regError($('email').parentNode,'Invalid email format',2);
			return false;
		}
		else if(e1!=e2) {
			regError($('email').parentNode,'Emails don\'t match.',2);
			return false;
		}
		return true;	
	}
	
	function _vPassengers() {
		var t=$('weightTable');
		if(!t)return;
		for(var i=0;(inp=t.getElementsByTagName('input')[i]);i++){
			if (inp.value=="") {
				regError(t,'Please provide passenger information for each participating person.',2);
				return false;
			}
		}
		return true;
	}
	
	
	function _vTravelDates(){
		var v1=$('vacdate1'),v2=$('vacdate2');
		var v1v=$F('vacdate1'),v2v=$F('vacdate2');
		
		if(v1v=="" || v2v==""){
			regError(v1.parentNode,'Please provide your vacation start and end dates',2);
			return false;
		} else if(!validateDate(v1v) || !validateDate(v2v)) {
				regError(v1.parentNode,'Invalid date format',2);
				return false;
		} else {
			var d1 = new Date();
			var d2 = new Date()
			d1.setYear(parseInt(v1v.substring(6,10)));
			d1.setMonth(parseInt(v1v.substring(0,2)-1));
			d1.setDate(parseInt(v1v.substring(3,5)));

			d2.setYear(parseInt(v2v.substring(6,10)));
			d2.setMonth(parseInt(v2v.substring(0,2)-1));
			d2.setDate(parseInt(v2v.substring(3,5)));

			var checkDate1=d1.getTime();
			var checkDate2=d2.getTime();
			if (checkDate1 >= checkDate2) {
				regError(v1.parentNode,'Vacation end date cannot be earlier to start date.',2);
				return false;
			}
		}
		return true;
	}
}

function validateStep3() {
	var f=$('tourBook3');
	if(!f)return;
	f.onsubmit=function() {
		var flag=true;
		clearErrors(this);
		if(_cancelForm()){
			flag=true;
		} else {
			if(!_vCCname())
				flag=false;
			if(!_vCCnumber())
				flag=false;
			if(!_vTerms())
				flag=false;
		}
		return flag;
	}
	
	function _cancelForm(){
		if($F('resetForm')){
			return true;
		}
		return false;
	}
	
	function _vCCname(){
		if($F('ccName')==""){
			regError($('ccName').parentNode,'Please provide the name from credit card',2);
			return false;
		}
		return true;
	}

	function _vCCnumber() {
		var c=replaceAll($F('ccNumber'),' ','');
		if(c=="") {
			regError($('ccNumber').parentNode,'Please provide your credit card number',2);
			return false;
		}
		else if(!Mod10(c.replace(' ',''))) {
			regError($('ccNumber').parentNode,'Invalid credit card number',2);
			return false;		
		}
		return true;
	}

	function _vTerms(){
		if(!$F('agree')){
			regError($('agree').parentNode,'You must accept the terms & conditions.',2);
			return false;
		}
		return true;
	}	
}



/* This script and many more are available free online at
The JavaScript Source!! http://javascript.internet.com
Created by: David Leppek :: https://www.azcode.com/Mod10

Basically, the alorithum takes each digit, from right to left and muliplies each second
digit by two. If the multiple is two-digits long (i.e.: 6 * 2 = 12) the two digits of
the multiple are then added together for a new number (1 + 2 = 3). You then add up the
string of numbers, both unaltered and new values and get a total sum. This sum is then
divided by 10 and the remainder should be zero if it is a valid credit card. Hense the
name Mod 10 or Modulus 10. */
function Mod10(ccNumb) {  // v2.0
	var valid = "0123456789"  // Valid digits in a credit card number
	var len = ccNumb.length;  // The length of the submitted cc number
	var iCCN = parseInt(ccNumb);  // integer of ccNumb
	var sCCN = ccNumb.toString();  // string of ccNumb
	sCCN = sCCN.replace (/^\s+|\s+$/g,'');  // strip spaces
	var iTotal = 0;  // integer total set at zero
	var bNum = true;  // by default assume it is a number
	var bResult = false;  // by default assume it is NOT a valid cc
	var temp;  // temp variable for parsing string
	var calc;  // used for calculation of each digit

	// Determine if the ccNumb is in fact all numbers
	for (var j=0; j<len; j++) {
		temp = "" + sCCN.substring(j, j+1);
		if (valid.indexOf(temp) == "-1"){bNum = false;}
	}

	// if it is NOT a number, you can either alert to the fact, or just pass a failure
	if(!bNum){
		/*alert("Not a Number");*/bResult = false;
	}

	// Determine if it is the proper length
	if((len == 0)&&(bResult)){  // nothing, field is blank AND passed above # check
		bResult = false;
	} else{  // ccNumb is a number and the proper length - let's see if it is a valid card number
		if(len >= 15){  // 15 or 16 for Amex or V/MC
			for(var i=len;i>0;i--){  // LOOP throught the digits of the card
				calc = parseInt(iCCN) % 10;  // right most digit
				calc = parseInt(calc);  // assure it is an integer
				iTotal += calc;  // running total of the card number as we loop - Do Nothing to first digit
				i--;  // decrement the count - move to the next digit in the card
				iCCN = iCCN / 10;                               // subtracts right most digit from ccNumb
				calc = parseInt(iCCN) % 10 ;    // NEXT right most digit
				calc = calc *2;                                 // multiply the digit by two
				// Instead of some screwy method of converting 16 to a string and then parsing 1 and 6 and then adding them to make 7,
				// I use a simple switch statement to change the value of calc2 to 7 if 16 is the multiple.
				switch(calc){
					case 10: calc = 1; break;       //5*2=10 & 1+0 = 1
					case 12: calc = 3; break;       //6*2=12 & 1+2 = 3
					case 14: calc = 5; break;       //7*2=14 & 1+4 = 5
					case 16: calc = 7; break;       //8*2=16 & 1+6 = 7
					case 18: calc = 9; break;       //9*2=18 & 1+8 = 9
					default: calc = calc;           //4*2= 8 &   8 = 8  -same for all lower numbers
				}
				iCCN = iCCN / 10;  // subtracts right most digit from ccNum
				iTotal += calc;  // running total of the card number as we loop
			}  // END OF LOOP
			if ((iTotal%10)==0){  // check to see if the sum Mod 10 is zero
				bResult = true;  // This IS (or could be) a valid credit card number.
			} else {
				bResult = false;  // This could NOT be a valid credit card number
			}
		}
	}
	return bResult; // Return the results
}

function showIndicator()
{
	//removeIndicator();
	var holder = document.createElement('div');
	var indicator = document.createElement('img');
	indicator.src = APP_URI+"images/indicator.gif";
	indicator.id = 'indicator';
	indicator.alt = 'Please wait';
	var x= 16;
	var y=16;
	indicator.height = 16;
	indicator.width = 16;
	
	var off=0;
	// only do this for ie
	if(typeof(document.media)=='string'){
		// scrolling offset calculation via www.quirksmode.org
		if (self.pageYOffset){off = self.pageYOffset;}
		else if (document.documentElement && document.documentElement.scrollTop) {off = document.documentElement.scrollTop; }
		else if (document.body) {off = document.body.scrollTop; }
	}
	
	
	holder.appendChild(indicator);
	document.getElementsByTagName('body')[0].appendChild(holder);
}

function removeIndicator()
{
	if ($('indicator')) 
		Element.remove($('indicator'));		
}
function popImage(filename, filetitle,width,height)
{
	var s = {
		fi		: new Image(),
		fname	: filename,
		title	: filetitle,
		width	: width,
		height	: height
	};
	
	s.fi.src = s.fname;

	showIndicator();
	s.fi.onload = loadThePopup(s);
//	s.fi.onload = function() {

}

function loadThePopup(s){

		removeIndicator();
		if ($('popunder')) 
			Element.remove($('popunder'));
		var pu = document.createElement('div');
		mySetAttribute(pu,"id","poppedUp");
		
		mySetAttribute(pu,'id','popunder');
	
		var a=document.createElement('a');
		mySetAttribute(a,'href','#');
		
		a.onclick = function(e){
			Element.remove(pu);stoplink(e);
		}

		var cl=document.createElement('a');
		mySetAttribute(cl,'href',"#");
		mySetAttribute(cl,'id',"compare_close");
		cl.appendChild(document.createTextNode('Close this image [x]'));
		cl.onclick=function(e){
			Element.remove(this.parentNode);
			stoplink(e)
		};

		var im=document.createElement('img');
		mySetAttribute(im,'src',s.fname);
		mySetAttribute(im,'alt',s.title);
		mySetAttribute(im,'title','Click to close [x]');

		var off=0;
		// only do this for ie
		if(typeof(document.media)=='string'){
			// scrolling offset calculation via www.quirksmode.org
			if (self.pageYOffset){off = self.pageYOffset;}
			else if (document.documentElement && document.documentElement.scrollTop) {off = document.documentElement.scrollTop; }
			else if (document.body) {off = document.body.scrollTop; }
		}


		var x=s.width;
		var y=s.height;
		
		mySetAttribute(im,'width',x);
		mySetAttribute(im,'height',y);
		pu.style.width=x+"px";
		pu.style.height=y+cl.height+"px";
		pu.style.marginLeft=-(x/2)+"px";
		pu.style.marginTop=-(y/2)+off+"px";
		a.appendChild(im);
		pu.appendChild(cl);		
		pu.appendChild(a);
		document.getElementsByTagName('body')[0].appendChild(pu);
		a.focus();
	//}
}

function preloadImages(){
	if(document.images){
		var imgObject = new Array();
		var imgArray = new Array();
		var imgs=document.getElementsByClassName('bigImage');
		for(var i=0;i<imgs.length;i++){
			imgArray[i] = imgs[i].getAttribute('href');
		}
		for(var i=0;i<imgs.length;i++){
			imgObject[i] = new Image();
			imgObject[i].src = imgArray[i];
		}		
	}
}

//SLIDESHOW - NEWEST
function closeThumbnail()
{
	var theBody = document.getElementsByTagName("body")[0];
	var theCanvasShadow = document.getElementById("canvasShadow");
	
	//theBody.style.backgroundColor = "#fff";
	theCanvasShadow.className = "hidden";
	
	return false;
}


function closeWindow()
{
	window.close();	
	return false;
}

function theSlideShow(){
	
	var theBody = document.getElementsByTagName("body")[0];
	var theCanvasShadow = document.getElementById("canvasShadow");
	var theCloseLink = document.createElement("a");
	var theContentHeight = 561;
	var theDD = document.createElement("dd");
	var theDDInner = document.createElement("div");
	var theDL = document.createElement("dl");
	var theDT = document.createElement("dt");
	var theIDNum = 0;
	var theImage = document.createElement("img");
	var theNextImage = document.createElement("img");
	var theLinksContainer = document.createElement("div");
	var theNextLink = document.createElement("a");
	var thePreviousLink = document.createElement("a");
	var theDesc = document.createElement("div");
	var theSpan = document.createElement("span");
	
	alert(this.id);
	theIDNum = parseInt(this.id.replace(/.*thumbnailLink(.*[0-9]).*/, "$1"));

	if(isNaN(theIDNum)){
		theIDNum = 1;	
	}

	var theTotal = 0;
	for(var i = 1; i<50; i++){
		if (document.getElementById("thumbnailLink" + i)){

		} else {
			theTotal = i;
			break;			
		}
	}
	theTotal--;

	theDesc.innerHTML = theIDNum + ' of '+theTotal+'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'+document.getElementById('thumbnailLink'+theIDNum).innerHTML;
	theDesc.className = "theDescription";

	

	theCanvasShadow.innerHTML = "";

	//theBody.style.backgroundColor = "#000000";
	theCanvasShadow.className = "on";
	
	theImage.id = "exampleImage";
	theImage.src = this.href.replace(/\?.*/, "");
	theImage.alt = this.title.replace(/.*/, theDesc.innerHTML);
	
	theDL.style.width = "900px";
	theDL.style.marginTop = parseInt((theContentHeight - 100 - 10 - 27 - 10) / 2) + "px";
	
	theSpan.innerHTML = theImage.alt;
	
	theLinksContainer.id = "linksContainer";

	thePreviousLink.className = "previousLink";
	
	if (document.getElementById("thumbnailLink" + (theIDNum - 1)))
	{
		var thePreviousThumbnail = document.getElementById("thumbnailLink" + (theIDNum - 1));
		
		thePreviousLink.id = thePreviousThumbnail.id + "Previous";
		thePreviousLink.href = thePreviousThumbnail.href;
		thePreviousLink.onclick = theSlideShow;
		thePreviousLink.title = thePreviousThumbnail.title;
		thePreviousLink.innerHTML = "&laquo; previous photo";
	}
	else
	{
		thePreviousLink.name = "none";
		thePreviousLink.className += " off";
	}

	theCloseLink.id = "closeLink";
	theCloseLink.className = "closeLink";
	theCloseLink.href = "#";
	theCloseLink.onclick = closeThumbnail;
	theCloseLink.title = "Close this image";
	theCloseLink.innerHTML = "close window [x]";
	
	theNextLink.className = "nextLink";	
	
	if (document.getElementById("thumbnailLink" + (theIDNum + 1)))
	{
		var theNextThumbnail = document.getElementById("thumbnailLink" + (theIDNum + 1));
		
		theNextLink.id = theNextThumbnail.id + "Next";
		theNextLink.href = theNextThumbnail.href;
		theNextLink.onclick = theSlideShow;
		theNextLink.title = theNextThumbnail.title;
		theNextLink.innerHTML ="next photo &raquo;";
		
		theNextImage.id = "nextImage";
		theNextImage.src =	theNextThumbnail.href.replace(/\?.*/, "");
		theNextImage.style.visibility = "hidden";
		
	}
	else
	{
		theNextLink.name = "none";
		theNextLink.className += " off";
		
		theNextImage.src =	"";
	}

	theLinksContainer.appendChild(thePreviousLink);
	theLinksContainer.appendChild(theNextLink);
	theLinksContainer.appendChild(theCloseLink)	;
	theLinksContainer.appendChild(theDesc);
	theCanvasShadow.appendChild(theLinksContainer);
	theDT.appendChild(theImage);
	theDT.appendChild(theNextImage);
	theDDInner.appendChild(theSpan);
	theDD.appendChild(theDDInner);
	theDL.appendChild(theDT);
	theDL.appendChild(theDD);
	theCanvasShadow.appendChild(theDL);

	scroll(0,0);
	return false;		
}


function theSlideShow2(file_name){

	//alert(file_name);
	var theBody = document.getElementsByTagName("body")[0];
	//var theCanvasShadow = document.getElementById("canvasShadow2");
	var theCloseLink = document.createElement("a");
	var theContentHeight = 0;
	var theDD = document.createElement("dd");
	var theDDInner = document.createElement("div");
	var theDL = document.createElement("dl");
	var theDT = document.createElement("dt");
	var theIDNum = 0;
	var theImage = document.createElement("img");

	//var theImage = document.getElementById("exampleImage");
		
	//var theNextImage = document.createElement("img");
	//var theLinksContainer = document.createElement("div");
	var theNextLink = document.createElement("a");
	var thePreviousLink = document.createElement("a"); 


    var thePreviousContainer = document.getElementById("divPrevious");
    var theNextContainer = document.getElementById("divNext"); 
	var theCloseContainer = document.getElementById("divClose"); 
	var theMainImageContainer = document.getElementById("ShowImage"); 
	var theMsg = document.getElementById("DivShowMsg"); 
	var theOpenerId = window.opener.document.getElementById("hdnId"); 

	
	
	
//divCnt

	thePreviousContainer.innerHTML="";
    theNextContainer.innerHTML=""; 
	
	
	
	//var theDesc = document.createElement("div");

	  var theCounter = document.getElementById("divCnt");	
	  var theDesc = document.getElementById("divPlace");		

	
	theCounter.innerHTML="";
	theDesc.innerHTML="";
	theCloseContainer.innerHTML="";
	theMainImageContainer.innerHTML = "";
		

	
	var theSpan = document.createElement("span");
	var theBlank = document.createElement("div");

	
	
			if(!this.id || this.id==null)
			{		
			  if(theOpenerId.value=="")
				{
				  theIDNum = 1;			
				}		
			  else
				{
				   theIDNum = parseInt(theOpenerId.value);		
				}
			}
			else
			{
			  theIDNum = parseInt(this.id.replace(/.*thumbLink(.*[0-9]).*/, "$1"));
			}	
		
			if(isNaN(theIDNum)){
				theIDNum = 1;	
			}
		

	var theTotal = 0;
	for(var i = 1; i<50; i++){
		if (window.opener.document.getElementById("thumbLink" + i)){

		} else {
			theTotal = i;
			break;			
		}
	}
	theTotal--;
	
	
	theCounter.innerHTML = theIDNum + ' of '+theTotal+'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';

	

	theDesc.innerHTML = window.opener.document.getElementById('thumbLink'+theIDNum).innerHTML;

	

	document.title = window.opener.document.getElementById('thumbLink'+theIDNum).innerHTML;



	document.title +="| Blue Hawaiian Helicopters "
	

	theDesc.className = "SlideHeading";

	

	//theCanvasShadow.innerHTML = "";

	

	//theBody.style.backgroundColor = "#000000";

	//theCanvasShadow.className = "on";



	//theImage.id = "exampleImage";

<!--<table height="343" width="516"><tr><td valign="middle" align="center"><b>Loading photo please wait......</b></td></tr></table>-->	

if(!this.href || this.href=="undefined")
  { 	
	

		if(theOpenerId.value=="")
				{

				  theImage.src = file_name.replace(/\?.*/, "");
				}		
			  else
				{	
		  
				   theImage.src = window.opener.document.getElementById("thumbLink" + (theIDNum)).href;	
				}	
	
	

	
	 theImage.onreadystatechange = function() { 	

		//alert(theImage.readyState);	

  	 if(theImage.readyState!="complete")								
			{	
				//theMsg.style.position = 'relative';			
				theMsg.style.visibility = 'visible';												
				//divloading.className = "cropImageArea";
				
				theMainImageContainer.style.visibility = 'hidden';
			}
	   else if(theImage.readyState=="complete")
            {				
				//theMsg.style.position = 'absolute';
				theMsg.style.visibility = 'hidden';
				
				theMainImageContainer.style.visibility = 'visible';		
				theMainImageContainer.style.position = 'relative';
				//divchild.className = "cropImageArea";			
				
			}    
		};   
	 										

    theImage.alt = window.opener.document.getElementById('thumbLink'+theIDNum).innerHTML;
	//theImage.width="960";
  }
else
	{  

theImage.src = this.href.replace(/\?.*/, "");	

    theImage.onreadystatechange = function() { 	

		//alert(theImage.readyState);	

  	 if(theImage.readyState!="complete")								
			{				
				theMsg.style.visibility = 'visible';								
				//theMsg.style.position = 'relative';
				//divloading.className = "cropImageArea";
				
				theMainImageContainer.style.visibility = 'hidden';
			}
	   else if(theImage.readyState=="complete")
            {				
				
				//theMsg.style.position = 'absolute';	
				theMsg.style.visibility = 'hidden';				
				theMainImageContainer.style.visibility = 'visible';		
				theMainImageContainer.style.position = 'relative';
				//divchild.className = "cropImageArea";			
				
			}    
		};   
	
	  theImage.alt = window.opener.document.getElementById('thumbLink'+theIDNum).innerHTML;	
	  //theImage.width="960"; 		  
	}


 if(theImage.width>1000)
	{
	  theImage.width="1000";	     
	};



				
// Assigning Code Starts	

	theImage.style.align="center";
	theDL.style.width = "1025px";
	theDL.style.height = "700px";
	//theLinksContainer.style.width = "1025px";

	theBlank.style.width="100";

	theDL.style.marginTop = parseInt((theContentHeight - 100 - 10 - 27 - 10) / 2) + "px";
	
	theSpan.innerHTML = theImage.alt;
	
//	theLinksContainer.id = "linksContainer";

//	thePreviousLink.className = "previousLink";


	
	if (window.opener.document.getElementById("thumbLink" + (theIDNum - 1)))
	{
		
		
		var thePreviousThumbnail = window.opener.document.getElementById("thumbLink" + (theIDNum - 1));
		
		thePreviousLink.id = thePreviousThumbnail.id + "Previous";
		thePreviousLink.href = thePreviousThumbnail.href;
		thePreviousLink.onclick = theSlideShow2;
		thePreviousLink.title = thePreviousThumbnail.title;
		thePreviousLink.innerHTML = '<img src="/images/popupImages/slideBarPreviousBt.gif" width="79" height="33" border="0" Id="ImgPre">';    //&laquo; previous photo
	}
	else
	{
		
	///	thePreviousLink.name = "none";
	///	thePreviousLink.className += " off";
	}



	theCloseLink.id = "closeLink";
	theCloseLink.className = "closeLink";
	theCloseLink.href = "#";
	theCloseLink.onclick = closeWindow;
	theCloseLink.title = "Close this image";
	theCloseLink.innerHTML = '<img src="/images/popupImages/SlideCloseBT.gif" width="65" height="22" border="0">'; /// close window [x]
    //theCloseLink.align="left";
	
	///theNextLink.className = "nextLink";	
	

	
	if (window.opener.document.getElementById("thumbLink" + (theIDNum + 1)))
	{

	
		var theNextThumbnail = window.opener.document.getElementById("thumbLink" + (theIDNum + 1));	
		
		theNextLink.id = theNextThumbnail.id + "Next";
		theNextLink.href = theNextThumbnail.href;
		theNextLink.onclick = theSlideShow2;
		theNextLink.title = theNextThumbnail.title;
		theNextLink.innerHTML ='<img src="/images/popupImages/slideBarNextBt.gif" width="79" height="33" border="0" Id="ImgNex">';  //next photo &raquo;
		
		//theNextImage.id = "nextImage";
		//theNextImage.src =	theNextThumbnail.href.replace(/\?.*/, "");
		//theNextImage.style.visibility = "hidden";
		
	}
	else
	{
	
	///	theNextLink.name = "none";
	///	theNextLink.className += " off";				
	}

	
	///theLinksContainer.appendChild(thePreviousLink);
	///theLinksContainer.appendChild(theNextLink);
	///theLinksContainer.appendChild(theCloseLink)	;
	///theLinksContainer.appendChild(theBlank);
	///theLinksContainer.appendChild(theDesc);
///	theCanvasShadow.appendChild(theLinksContainer);
	thePreviousContainer.appendChild(thePreviousLink);
	theNextContainer.appendChild(theNextLink);
	theCloseContainer.appendChild(theCloseLink);

	theMainImageContainer.appendChild(theImage);

	//theDT.appendChild(theImage);
	///theDT.appendChild(theNextImage);
	theDDInner.appendChild(theSpan);
	theDD.appendChild(theDDInner);
	theDL.appendChild(theDT);
	theDL.appendChild(theDD);
	//theCanvasShadow.appendChild(theDL);

	scroll(0,0);
	return false;		
}


// Detecting Flash player Functions

function JSGetSwfVer(i){	

	if (navigator.plugins != null && navigator.plugins.length > 0) {
		if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
			var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
      		var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;
			descArray = flashDescription.split(" ");
			tempArrayMajor = descArray[2].split(".");
			versionMajor = tempArrayMajor[0];
			versionMinor = tempArrayMajor[1];
			if ( descArray[3] != "" ) {
				tempArrayMinor = descArray[3].split("r");
			} else {
				tempArrayMinor = descArray[4].split("r");
			}
      		versionRevision = tempArrayMinor[1] > 0 ? tempArrayMinor[1] : 0;
            flashVer = versionMajor + "." + versionMinor + "." + versionRevision;
      	} else {
			flashVer = -1;
		}
	}
	
	else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;
	
	else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;
	
	else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;
	
	else {
		
		flashVer = -1;
	}
	return flashVer;
} 



/*function VBGetSwfVer(i)
{
  var swControl, swVersion;
  swVersion = 0;


swControl = new ActiveXObject("ShockwaveFlash.ShockwaveFlash." + i.toString());

  if((IsObject(swControl))){
    swVersion = swControl.GetVariable("$version");
  }
  return swVersion;
}*/


function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision) 
{

var isIE  = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;
 	reqVer = parseFloat(reqMajorVer + "." + reqRevision);
 
	for (i=25;i>0;i--) {	
		if (isIE && isWin && !isOpera) {
			versionStr = VBGetSwfVer(i);
		} else {
			versionStr = JSGetSwfVer(i);
		}

		if (versionStr == -1 ) { 
			return false;
		} else if (versionStr != 0) {
			if(isIE && isWin && !isOpera) {
				tempArray         = versionStr.split(" ");
				tempString        = tempArray[1];
				versionArray      = tempString .split(",");				
			} else {
				versionArray      = versionStr.split(".");
			}
			versionMajor      = versionArray[0];
			versionMinor      = versionArray[1];
			versionRevision   = versionArray[2];
			
			versionString     = versionMajor + "." + versionRevision;   
			versionNum        = parseFloat(versionString);
        	
			if ( (versionMajor > reqMajorVer) && (versionNum >= reqVer) ) {
				return true;
			} else {
				return ((versionNum >= reqVer && versionMinor >= reqMinorVer) ? true : false );	
			}
		}
	}	
	return (reqVer ? false : 0.0);
}

function lib_bwcheck(){ //Browsercheck (needed)
        this.ver=navigator.appVersion
        this.agent=navigator.userAgent
        this.dom=document.getElementById?1:0
        this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0;
        this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom)?1:0;
        this.ie4=(document.all && !this.dom)?1:0;
        this.ie=this.ie4||this.ie5||this.ie6
        this.mac=this.agent.indexOf("Mac")>-1
        this.opera5=this.agent.indexOf("Opera 5")>-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
        if(this.ie6 || this.ie5 || this.ie4)
			{
              return "ie";  
			}   
		else if(this.ns4 || this.ns6 || this.opera5)
			{
              return "other";
			}
 
}


function alertcheck(url)
{

	//alert(url);
	//var chkBrowser = lib_bwcheck();

//alert(url);
// Globals
// Major version of Flash required
var requiredMajorVersion = 8;
// Minor version of Flash required
var requiredMinorVersion = 0;
// Minor version of Flash required
var requiredRevision = 0;
// the version of javascript supported
var jsVersion = 1.0;



//var isIE  = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;
jsVersion = 1.1;


 
var hasRightVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);

if(hasRightVersion) {  
    var oeTags = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'
    + 'width="720" height="640"'
    + 'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab" id="blue">'
    + '<param name="movie" value="'+url+'" /><param name="quality" value="high" /><param name="bgcolor" value="#14285f" />'
    + '<embed src="'+url+'" quality="high" bgcolor="#14285f" '
    + 'width="720" height="640" name="detectiontest" align="middle"'
    + 'play="true"'
    + 'loop="false"'
    + 'quality="high"'
    + 'allowScriptAccess="sameDomain"'
    + 'type="application/x-shockwave-flash"'
    + 'pluginspage="http://www.macromedia.com/go/getflashplayer">'
    + '<\/embed>'
    + '<\/object>';
    document.write(oeTags);  	
	//alert(oeTags);
  } else {  
    var alternateContent = '<p align="center"><font color="red">An old version of the Flash plugin was detected. <strong><a href="http://www.macromedia.com/go/getflash/" >Please upgrade your Flash plugin.</a></strong></font></p>';
    document.write(alternateContent);  
  }
}





