// pass min and max -measured against window width
function P7_MinMaxW(a,b){
   var nw="auto",w=document.documentElement.clientWidth;
   if(w>=b){nw=b+"px";}if(w<=a){nw=a+"px";}return nw;
}

// email encoding for contact us link for Owner Area problems logging in - sidebar under menu
// change function call for more than one per page

// for contact page
var edress2 = 'info_at_kapaluara_dot_com';
function get_edress2(){
var re= /_at_/gi;
edress2 = edress2.replace(re,'@');
var re= /_dot_/gi;
edress2 = edress2.replace(re,'.');
var the_link="mai" + "lto" +":"+edress2+"?subject=Inquiry%20from%20the%20KapaluaRA%20website&body=" ;
window.location=the_link;
}

// for login help
var edress = 'info_at_kapaluara_dot_com';
function get_edress(){
var re= /_at_/gi;
edress = edress.replace(re,'@');
var re= /_dot_/gi;
edress = edress.replace(re,'.');
var the_link="mai" + "lto" +":"+edress+"?subject=Login%20help%20needed%20at%20the%20KapaluaRA%20website&body=" ;
window.location=the_link;
}

function P7_writeStyles(op,a){ //v1.2 by PVII
 if(op==0||document.getElementById){
 var tS="<sty"+"le type=\"text/css\">";
 tS+="\n"+a+"\n<"+"/sty"+"le>";document.write(tS);}
}
P7_writeStyles(1,'.hidefaq{display: none;}');
P7_writeStyles(1,'.faqintro{display: block;}');

function P7_swapClass(){ //v1.4 by PVII
 var i,x,tB,j=0,tA=new Array(),arg=P7_swapClass.arguments;
 if(document.getElementsByTagName){for(i=4;i<arg.length;i++){tB=document.getElementsByTagName(arg[i]);
  for(x=0;x<tB.length;x++){tA[j]=tB[x];j++;}}for(i=0;i<tA.length;i++){
  if(tA[i].className){if(tA[i].id==arg[1]){if(arg[0]==1){
  tA[i].className=(tA[i].className==arg[3])?arg[2]:arg[3];}else{tA[i].className=arg[2];}
  }else if(arg[0]==1 && arg[1]=='none'){if(tA[i].className==arg[2] || tA[i].className==arg[3]){
  tA[i].className=(tA[i].className==arg[3])?arg[2]:arg[3];}
  }else if(tA[i].className==arg[2]){tA[i].className=arg[3];}}}}
}


function JustSoPicWindow(imageName,imageWidth,imageHeight,alt,bgcolor,hugger,hugMargin) {
// by E Michael Brandt of ValleyWebDesigns.com - Please leave these comments intact.
// version 3.0.4

   if (bgcolor=="") {
      bgcolor="#FFFFFF";
   }
   var adj=10
   var w = screen.width;
   var h = screen.height;
   var byFactor=1;

   if(w<740){
     var lift=0.90;
   }
   if(w>=740 & w<835){
     var lift=0.91;
   }
   if(w>=835){
     var lift=0.93;
   }
   if (imageWidth>w){
     byFactor = w / imageWidth;
     imageWidth = w;
     imageHeight = imageHeight * byFactor;
   }
   if (imageHeight>h-adj){
     byFactor = h / imageHeight;
     imageWidth = (imageWidth * byFactor);
     imageHeight = h;
   }

   var scrWidth = w-adj;
   var scrHeight = (h*lift)-adj;

   if (imageHeight>scrHeight){
     imageHeight=imageHeight*lift;
     imageWidth=imageWidth*lift;
   }

   var posLeft=0;
   var posTop=0;

   if (hugger == "hug image"){
     if (hugMargin == ""){
       hugMargin = 0;
     }
     var scrHeightTemp = imageHeight - 0 + 2*hugMargin;
     if (scrHeightTemp < scrHeight) {
      scrHeight = scrHeightTemp;
     }
     var scrWidthTemp = imageWidth - 0 + 2*hugMargin;
     if (scrWidthTemp < scrWidth) {
      scrWidth = scrWidthTemp;
     }

     if (scrHeight<100){scrHeight=100;}
     if (scrWidth<100){scrWidth=100;}

     posTop =  ((h-(scrHeight/lift)-adj)/2);
     posLeft = ((w-(scrWidth)-adj)/2);
   }

   if (imageHeight > (h*lift)-adj || imageWidth > w-adj){
      imageHeight=imageHeight-adj;
      imageWidth=imageWidth-adj;
   }
   posTop = parseInt(posTop);
   posLeft = parseInt(posLeft);
   scrWidth = parseInt(scrWidth);
   scrHeight = parseInt(scrHeight);

   var agt=navigator.userAgent.toLowerCase();
   if (agt.indexOf("opera") != -1){
     var args= new Array();
     args[0]='parent';
     args[1]=imageName;
     var i ; document.MM_returnValue = false;
     for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
   } else {
   newWindow = window.open("vwd_justso.htm","newWindow","width="+scrWidth+",height="+scrHeight+",left="+posLeft+",top="+posTop);
   newWindow.document.open();
   newWindow.document.write('<html><title>'+alt+'</title><body leftmargin="0" topmargin="0" marginheight="0" marginwidth="0" bgcolor='+bgcolor+' onBlur="self.close()" onClick="self.close()">');
   newWindow.document.write('<table width='+imageWidth+' border="0" cellspacing="0" cellpadding="0" align="center" height='+scrHeight+' ><tr><td>');
   newWindow.document.write('<img src="'+imageName+'" width='+imageWidth+' height='+imageHeight+' alt="Click screen to close" >');
   newWindow.document.write('</td></tr></table></body></html>');
   newWindow.document.close();
   newWindow.focus();
   }
}



function flvFPW1(){//v1.44
// Copyright 2002-2004, Marja Ribbers-de Vroed, FlevOOware (www.flevooware.nl/dreamweaver/)
var v1=arguments,v2=v1[2].split(","),v3=(v1.length>3)?v1[3]:false,v4=(v1.length>4)?parseInt(v1[4]):0,v5=(v1.length>5)?parseInt(v1[5]):0,v6,v7=0,v8,v9,v10,v11,v12,v13,v14,v15,v16;v11=new Array("width,left,"+v4,"height,top,"+v5);for (i=0;i<v11.length;i++){v12=v11[i].split(",");l_iTarget=parseInt(v12[2]);if (l_iTarget>1||v1[2].indexOf("%")>-1){v13=eval("screen."+v12[0]);for (v6=0;v6<v2.length;v6++){v10=v2[v6].split("=");if (v10[0]==v12[0]){v14=parseInt(v10[1]);if (v10[1].indexOf("%")>-1){v14=(v14/100)*v13;v2[v6]=v12[0]+"="+v14;}}if (v10[0]==v12[1]){v16=parseInt(v10[1]);v15=v6;}}if (l_iTarget==2){v7=(v13-v14)/2;v15=v2.length;}else if (l_iTarget==3){v7=v13-v14-v16;}v2[v15]=v12[1]+"="+v7;}}v8=v2.join(",");v9=window.open(v1[0],v1[1],v8);if (v3){v9.focus();}document.MM_returnValue=false;return v9;}



