<!--
function getPageSizeWithScroll(){     
if (window.innerHeight && window.scrollMaxY) 
{// Firefox         
yWithScroll = window.innerHeight + window.scrollMaxY;         
xWithScroll = window.innerWidth + window.scrollMaxX;  } 
else if (document.body.scrollHeight > document.body.offsetHeight)
{ // all but Explorer Mac         
yWithScroll = document.body.scrollHeight;         
xWithScroll = document.body.scrollWidth;     } 
else { // works in Explorer 6 Strict, Mozilla (not FF) and Safari        
 yWithScroll = document.body.offsetHeight;         
 xWithScroll = document.body.offsetWidth;       }     
 // arrayPageSizeWithScroll = new Array(xWithScroll,yWithScroll);     
 //alert( 'The height is ' + yWithScroll + ' and the width is ' + xWithScroll );     
  //return arrayPageSizeWithScroll; } 
  return yWithScroll } 
  
function OpenWindow(){
	var Top
	if(document.body.scrollTop){Top=document.body.scrollTop}else{Top=document.documentElement.scrollTop}
	document.getElementById("overlay").style.top=Top + 100 + "px";
	document.getElementById("overlay").style.display="block";
	document.getElementById("backlay").style.display="block";
	document.getElementById("ImgClick").src="images/vessel_schematic_lg_newest.jpg";
	transOpac("backlay", 200, 0, 85);
	transOpac("overlay", 300, 0, 100);
	transOpac("ImgClick", 100, 0, 100);}
function CloseWindow(){
	document.getElementById("overlay").style.display="none";
	document.getElementById("backlay").style.display="none";
	changeOpac("backlay",0);
	changeOpac("overlay",0);
	changeOpac("ImgClick",0);
}	
	
	
	
var NewsFeed = new Array();

NewsFeed[0]= new Array();
NewsFeed[0][0]="September, 2009"; //Date 
NewsFeed[0][1]="Babcock Integrated Technology: Inovative Desalination Vessel Opens up New Frontiers in Oil and Gas"; //Title
NewsFeed[0][2]="BabcockEIC.pdf"; //PDF

NewsFeed[1]= new Array();
NewsFeed[1][0]="May, 2009"; //Date 
NewsFeed[1][1]="REUTERS: WATER STANDARD Receives 2009 Global Water Award"; //Title
NewsFeed[1][2]="ReutersGWI_AwardRelease_5-12-09.pdf"; //PDF

NewsFeed[2]= new Array();
NewsFeed[2][0]="October, 2008"; //Date 
NewsFeed[2][1]="EARTH Magazine: GSA meeting: Water, water everywhere...creating some to drink"; //Title
NewsFeed[2][2]="Houston_GSA_Mtg_Water_Water_Everywhere_Oct2008.pdf"; //PDF

NewsFeed[3]= new Array();
NewsFeed[3][0]="October, 2008"; //Date 
NewsFeed[3][1]="Arizona Water Resource: Seagoing Desalination Plant Touts Environmental Benefits"; //Title
NewsFeed[3][2]="AX_WaterResourceSeagoingVesselTouts_10-2008.pdf"; //PDF

NewsFeed[4]= new Array();
NewsFeed[4][0]="October 6, 2008"; //Date 
NewsFeed[4][1]="Discovery News: Old Ships Provide Portable Water Source"; //Title
NewsFeed[4][2]="DISCOVER_CHANNEL_OldShipsProvidePortableWaterSource_10-2008.pdf"; //PDF

NewsFeed[5]= new Array();
NewsFeed[5][0]="October, 2008"; //Date 
NewsFeed[5][1]="Water Desalination Report #36"; //Title
NewsFeed[5][2]="WDR2008-36_10-6-08_WS_piece.pdf"; //PDF

NewsFeed[6]= new Array();
NewsFeed[6][0]="September, 2008"; //Date 
NewsFeed[6][1]="GWI: Water Standard prepares to set sail"; //Title
NewsFeed[6][2]="GWI_Article_2pg_9-2008.pdf"; //PDF

NewsFeed[7]= new Array();
NewsFeed[7][0]="August 16, 2008"; //Date 
NewsFeed[7][1]="TheNational: UAE eyes portable desalination"; //Title
NewsFeed[7][2]="UAE_eyes_portable_desalination_8-16-2008.pdf"; //PDF

NewsFeed[8]= new Array();
NewsFeed[8][0]="June 11, 2008"; //Date 
NewsFeed[8][1]="<strong>Discover: </strong>Water, Water Everywhere, So Let's All Have a Drink"; //Title
NewsFeed[8][2]="DISCOVER-Water.pdf"; //PDF

NewsFeed[9]= new Array();
NewsFeed[9][0]="April 30, 2008"; //Date 
NewsFeed[9][1]="KSBW.com"; //Title
NewsFeed[9][2]="KSBW_CA_4-30-2008.pdf"; //PDF


// Note Almost All Characters can be used here accept quotation marks unless proceeded by a forward slash for each quotation mark



function MakeNews(){
var i = 0
 for(i = 0; i < NewsFeed.length; i++) {
 MakeNewItem(NewsFeed[i][0], NewsFeed[i][1], NewsFeed[i][2]);
 }
}

function MakeNewItem(Date, Title, File){
var Text = ""
Text += "<div class='pubdate'>"+Date+"</div>";
Text += "<div class='paragraphside'>"+Title+"</div>";
Text += "<div style='padding:3px 0 8px 0;'>";
Text += "<div style='float:left;'><a href='pdf/"+File+"' class='pubdl' target='_blank'>Download PDF</a></div>";
Text += "<div style='float:left; padding-left:5px;'><a href='pdf/"+File+"' class='pubdl' target='_blank'><img src='images/pdf.gif' alt='Download' /></a></div>";
Text += "</div>";
Text += "<br style='clear:both'>";
document.write(Text);
}







function ShowSubNav(id){
document.getElementById(id).style.display='block';
}
function HideSubNavs(){
var i = 0
for(i=1; i<=6; i++){
document.getElementById("tab"+i).style.display='none';
}
}

var SetTimer = ""
function TimedHide(){
if (SetTimer != ""){clearTimeout(SetTimer);}
SetTimer = window.setTimeout("HideSubNavs()", 3000)
}







var GalleryRandom1 = new Array();
GalleryRandom1[0]= new Array();
GalleryRandom1[0]='images/left__01.jpg';

GalleryRandom1[1]= new Array();
GalleryRandom1[1]='images/left__02.jpg';

GalleryRandom1[2]= new Array();
GalleryRandom1[2]='images/left__03.jpg';

GalleryRandom1[3]= new Array();
GalleryRandom1[3]='images/left__04.jpg';

GalleryRandom1[4]= new Array();
GalleryRandom1[4]='images/left__05.jpg';

GalleryRandom1[5]= new Array();
GalleryRandom1[5]='images/left__06.jpg';

GalleryRandom1[6]= new Array();
GalleryRandom1[6]='images/left__07.jpg';

GalleryRandom1[7]= new Array();
GalleryRandom1[7]='images/left__08.jpg';

GalleryRandom1[8]= new Array();
GalleryRandom1[8]='images/left__09.jpg';

GalleryRandom1[9]= new Array();
GalleryRandom1[9]='images/left__10.jpg';

GalleryRandom1[10]= new Array();
GalleryRandom1[10]='images/left__11.jpg';

GalleryRandom1[11]= new Array();
GalleryRandom1[11]='images/left__12.jpg';

GalleryRandom1[12]= new Array();
GalleryRandom1[12]='images/left__13.jpg';

GalleryRandom1[13]= new Array();
GalleryRandom1[13]='images/left__14.jpg';

GalleryRandom1[14]= new Array();
GalleryRandom1[14]='images/left__15.jpg';

GalleryRandom1[15]= new Array();
GalleryRandom1[15]='images/left__16.jpg';

GalleryRandom1[16]= new Array();
GalleryRandom1[16]='images/left__17.jpg';

GalleryRandom1[17]= new Array();
GalleryRandom1[17]='images/left__18.jpg';

GalleryRandom1[18]= new Array();
GalleryRandom1[18]='images/left__19.jpg';

GalleryRandom1[19]= new Array();
GalleryRandom1[19]='images/left__20.jpg';

GalleryRandom1[20]= new Array();
GalleryRandom1[20]='images/left__21.jpg';

GalleryRandom1[21]= new Array();
GalleryRandom1[21]='images/left__22.jpg';

GalleryRandom1[22]= new Array();
GalleryRandom1[22]='images/left__23.jpg';

GalleryRandom1[23]= new Array();
GalleryRandom1[23]='images/left__24.jpg';

GalleryRandom1[24]= new Array();
GalleryRandom1[24]='images/left__25.jpg';

GalleryRandom1[25]= new Array();
GalleryRandom1[25]='images/left__26.jpg';

GalleryRandom1[26]= new Array();
GalleryRandom1[26]='images/left__27.jpg';


var GalleryRandom2 = new Array();
GalleryRandom2[0]= new Array();
GalleryRandom2[0]='images/right_01.jpg';

GalleryRandom2[1]= new Array();
GalleryRandom2[1]='images/right_02.jpg';

GalleryRandom2[2]= new Array();
GalleryRandom2[2]='images/right_03.jpg';

GalleryRandom2[3]= new Array();
GalleryRandom2[3]='images/right_04.jpg';

GalleryRandom2[4]= new Array();
GalleryRandom2[4]='images/right_05.jpg';

GalleryRandom2[5]= new Array();
GalleryRandom2[5]='images/right_06.jpg';

GalleryRandom2[6]= new Array();
GalleryRandom2[6]='images/right_07.jpg';

GalleryRandom2[7]= new Array();
GalleryRandom2[7]='images/right_08.jpg';

GalleryRandom2[8]= new Array();
GalleryRandom2[8]='images/right_09.jpg';

GalleryRandom2[9]= new Array();
GalleryRandom2[9]='images/right_10.jpg';

GalleryRandom2[10]= new Array();
GalleryRandom2[10]='images/right_11.jpg';

GalleryRandom2[11]= new Array();
GalleryRandom2[11]='images/right_12.jpg';

GalleryRandom2[12]= new Array();
GalleryRandom2[12]='images/right_13.jpg';

GalleryRandom2[13]= new Array();
GalleryRandom2[13]='images/right_14.jpg';

GalleryRandom2[14]= new Array();
GalleryRandom2[14]='images/right_15.jpg';





function getRandomImg(){

	Index1 = Math.floor(Math.random() * GalleryRandom1.length);
	Index2 = Math.floor(Math.random() * GalleryRandom2.length);
	document.getElementById("ImgRotate1").src = GalleryRandom1[Index1];
	document.getElementById("ImgRotate2").src = GalleryRandom2[Index2];

}




var bo_ns_id = 0;

function startIeFix(){
  if(isIE()){
    document.write('<div id="bo_ns_id_' + bo_ns_id + '"><!-- ');
  }
}

function endIeFix(){
  if(isIE()){
    document.write('</div>');
    var theObject = document.getElementById("bo_ns_id_" + bo_ns_id++);
    var theCode = theObject.innerHTML;
    theCode = theCode.substring(4 ,9+theCode.indexOf("</object>"))
    document.write(theCode);
  }
}

function isIE(){
  // only for Win IE 6+
  // But not in Windows 98, Me, NT 4.0, 2000
  var strBrwsr= navigator.userAgent.toLowerCase();
  if(strBrwsr.indexOf("msie") > -1 && strBrwsr.indexOf("mac") < 0){
    if(parseInt(strBrwsr.charAt(strBrwsr.indexOf("msie")+5)) < 6){
      return false;
    }
    if(strBrwsr.indexOf("win98") > -1 ||
       strBrwsr.indexOf("win 9x 4.90") > -1 ||
       strBrwsr.indexOf("winnt4.0") > -1 ||
       strBrwsr.indexOf("windows nt 5.0") > -1)
    {
      return false;
    }
    return true;
  }else{
    return false;
  }
}







function ProcessForm(){
if (validate_required("FirstName","Please Fill In a First Name")==false){return};
if (validate_required("LastName","Please Fill In Last Name")==false){return};
if (validate_required("DOBM","Please Select a Month of Birth")==false){return};
if (validate_required("DOBD","Please Select a Day of Birth")==false){return};
if (validate_required("StoreCode","Please Select a Store")==false){return};
if (validate_required("Address1","Please Fill In an Address")==false){return};
if (validate_required("City","Please Fill In a City")==false){return};
if (validate_required("State","Please Select a State")==false){return};
if (validate_required("EmailAddress","Please Enter a Valid Email Address")==false){return};
if (validate_email("EmailAddress","Please Enter a Valid Email Address")==false){return};
submitform();
}



function validate_required(field,alerttxt)
{
if (document.getElementById(field).value==null||document.getElementById(field).value=="")
  {alert(alerttxt);return false}
else {return true}
}

function validate_email(field,alerttxt)
{
apos=document.getElementById(field).value.indexOf("@")
dotpos=document.getElementById(field).value.lastIndexOf(".")
if (apos<1||dotpos-apos<2) 
  {alert(alerttxt);return false}
else {return true}
} 


function submitform()
{
	document.KalForm.action = "http://apps.fishbowl.com/a/fbjoin.asp";
	document.KalForm.submit();
	document.KalForm.method = "post";
}















function transOpac(id, millisec, opacStart, opacEnd) { 
    var speed = Math.round(millisec / 100); 
    var timer = 0; 

    if(opacStart > opacEnd) { 
        for(i = opacStart; i >= opacEnd; i--) { 
            setTimeout("changeOpac('" + id + "', " + i + ")",(timer * speed)); 
            timer++; 
        } 
    } else if(opacStart < opacEnd) { 
        for(i = opacStart; i <= opacEnd; i++) 
            { 
            setTimeout("changeOpac('" + id + "', " + i + ")",(timer * speed)); 
            timer++; 
        } 
    } 
} 



function transPosY(id, millisec, posStart, posEnd){
    var speed = Math.round(millisec / 100); 
    var timer = 0; 
    if(posStart > posEnd) { 
        for(i = posStart; i >= posEnd; i--) { 
            setTimeout("changePos('" + id + "',0 , " + i + ")",(timer * speed)); 
            timer++; 
        } 
    } else if(posStart < posEnd) { 
        for(i = posStart; i <= posEnd; i++) 
            { 
            setTimeout("changePos('" + id + "',0 , " + i + ")",(timer * speed)); 
            timer++; 
        } 
    } 
}

function transPosX(id, millisec, posStart, posEnd){
    var speed = Math.round(millisec / 100); 
    var timer = 0; 
    if(posStart > posEnd) { 
        for(i = posStart; i >= posEnd; i--) { 
            setTimeout("changePos('" + id + "', " + i + ", 0)",(timer * speed)); 
            timer++; 
        } 
    } else if(posStart < posEnd) { 
        for(i = posStart; i <= posEnd; i++) 
            { 
            setTimeout("changePos('" + id + "', " + i + ", 0)",(timer * speed)); 
            timer++; 
        } 
    } 
}



function transWidth(id, millisec, widthStart, widthEnd){
    var speed = Math.round(millisec / 100); 
    var timer = 0; 
    if(widthStart > widthEnd) { 
        for(i = widthStart; i >= widthEnd; i--) { 
            setTimeout("changeSize('" + id + "', " + i + ", 0)",(timer * speed)); 
            timer++; 
        } 
    } else if(widthStart < widthEnd) { 
        for(i = widthStart; i <= widthEnd; i++) 
            { 
            setTimeout("changeSize('" + id + "', " + i + ", 0)",(timer * speed)); 
            timer++; 
        } 
    } 
}

function transHeight(id, millisec, HeightStart, HeightEnd){
    var speed = Math.round(millisec / 100); 
    var timer = 0; 
    if(HeightStart > HeightEnd) { 
        for(i = HeightStart; i >= HeightEnd; i--) { 
            setTimeout("changeSize('" + id + "', 0, " + i + ")",(timer * speed)); 
            timer++; 
        } 
    } else if(HeightStart < HeightEnd) { 
        for(i = HeightStart; i <= HeightEnd; i++) 
            { 
            setTimeout("changeSize('" + id + "', 0, " + i + ")",(timer * speed)); 
            timer++; 
        } 
    } 
}



function changePos(id, x, y){
    var object = document.getElementById(id).style; 
    object.position="relative";
    if (x!=0){
    object.left=x+"px";
    }
    else if (y!=0){
    object.top=y+"px";
    }
}
function changeSize(id, width, height){
    var object = document.getElementById(id).style; 
    object.overflow='hidden'
    if (height!=0){
    object.height=height+"px";
    }
    else if (width!=0){
    object.width=width+"px";
    }
}
function changeOpac(id, opacity) { 
    var object = document.getElementById(id).style; 
    object.opacity = (opacity / 100); 
    object.MozOpacity = (opacity / 100); 
    object.KhtmlOpacity = (opacity / 100); 
    object.filter = "alpha(opacity=" + opacity + ")"; 
} 














function GetCurrentIndex(){
	if(Set2Random==false){
		if(CurrentIndex==(GalleryHome.length-1)){
			CurrentIndex = 0;
		}else{
			CurrentIndex ++;
		}
	}else{
		var RandLimit = GalleryHome.length-1;
		CurrentIndex = Math.floor(Math.random() * RandLimit);
	}
	return CurrentIndex;
}

function LoadFirstImage(){
	var ObjFront = document.getElementById("ImgRotateFront");
	ObjFront.src=GalleryHome[0];
	
	if(GalleryHome.length>0){
		TimerForGallery = setTimeout('UnLoadFrontImage()', TimeInterval);
	}
}

function UnLoadFrontImage(){
	var ObjBack = document.getElementById("ImgRotateBack");
	ObjBack.src=GalleryHome[GetCurrentIndex()];
	transOpac("ImgRotateFront", 1000, 100, 0);
	TimerForGallery = setTimeout('LoadFrontImage()', TimeInterval);
}

function LoadFrontImage() {
	var ObjFront = document.getElementById("ImgRotateFront");
	ObjFront.src=GalleryHome[GetCurrentIndex()];
	transOpac("ImgRotateFront", 1000, 0, 100);
	TimerForGallery = setTimeout('UnLoadFrontImage()', TimeInterval);
}







function openVideoPlayer(ixVideo,ixPlaylist,ixParentItem) {

		var width 			= '665';
		var height 			= '650';
		var window_params 	= 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width='+width+',height='+height+',left=100,top=50';

			var url 		= 'http://www.sundancechannel.com/player/#/500317044/230318514';
			window.open(url, 'scPlayer', window_params);

}