 	//////////////////////////////////////////////////////////////////////////////
	///                                                                        ///
	///       Copyright © 2010, I Bay Net Inc., All rights reserved            ///
	///       i Bay Net Inc.                                                   ///
	///       1412 N. Ft Harrison Ave.                                         ///
	///       Clearwater Florida 33758                                         ///
	///       Phone: 727 443-4041   www.ibay.net				               ///
	///                                                                        ///
	//////////////////////////////////////////////////////////////////////////////

rolls_local = new Array (8);
rolls_local[0] = new Image(); rolls_local[0].src = "../images/nav_on_01.gif";
rolls_local[1] = new Image(); rolls_local[1].src = "../images/nav_on_02.gif";
rolls_local[2] = new Image(); rolls_local[2].src = "../images/nav_on_03.gif";
rolls_local[3] = new Image(); rolls_local[3].src = "../images/nav_on_04.gif";
rolls_local[4] = new Image(); rolls_local[4].src = "../images/nav_on_05.gif";
rolls_local[5] = new Image(); rolls_local[5].src = "../images/nav_on_06.gif";
rolls_local[6] = new Image(); rolls_local[6].src = "../images/nav_on_07.gif";
rolls_local[7] = new Image(); rolls_local[7].src = "../images/nav_on_08.gif";


ups_local = new Array (8);
ups_local[0] = "../images/nav_off_01.gif";
ups_local[1] = "../images/nav_off_02.gif";
ups_local[2] = "../images/nav_off_03.gif";
ups_local[3] = "../images/nav_off_04.gif";
ups_local[4] = "../images/nav_off_05.gif";
ups_local[5] = "../images/nav_off_06.gif";
ups_local[6] = "../images/nav_off_07.gif";
ups_local[7] = "../images/nav_off_08.gif";


function swapLocal(img,swp) {
       document.images[img].src = rolls_local[swp].src;            
}


function swapBackLocal(img,swp) {
       document.images[img].src = ups_local[swp];          
}

function scrollBar() {
		if (document.layers) {
			if (window.innerHeight > 435) {			
				document.write("<tr><td><IMG src='App_Themes/Default/images/1_pixel.gif' width='2' height='" + parseInt(window.innerHeight - 430) + "' border='0'></td></tr>")
			}				
		}
}

// F U C T I O N   S H O W   L A Y E R S !!!
function writeRandImage() {
	//document.write("../<%=AppTheme%>/images/image_01.jpg")
	imgSrc = new Array(3);	
	imgSrc[0] = "App_Themes/Default/images/MainBMW.gif";
	imgSrc[1] = "App_Themes/Default/images/MainPorsche.gif";
	imgSrc[2] = "App_Themes/Default/images/MainBenz.gif";
	//imgSrc[3] = "../<%=AppTheme%>/images/image_04.jpe";		
    
   imgSrcCur = imgSrc[Math.floor(Math.random()*imgSrc.length)]  
	//" + imgSrcCur + "
	document.write("<img src='" + imgSrcCur + "' vspace=\"0\" alt=\"\" border=\"0\">");
}


function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_showHideLayers() { //v3.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}
function MM_HideLayers(numb){
	MM_showHideLayers('Layer'+numb+'','','hide');
}

// F U N C T I O N   I M A G E   S W A P
	function MM_preloadImages() { //v3.0
	var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
		var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
		if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
	}

	function MM_swapImgRestore() { //v3.0
	var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
	}

	function MM_swapImage() { //v3.0
	var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
	if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
	}


// O P E N   U P   A   P A G E 
function poplink(URL,status,scrollbars,width,height)
{
  	NewWindow = window.open(URL,"links",'toolbar=no,menubar=0,status='+status+',copyhistory=2,scrollbars='+scrollbars+',resizable=0,location=0,width='+width+',height='+height);
	NewWindow.location = URL;
	//blur();
}



// <!-- Function to open members window
//var url = document.loc.url.value;
//var storage = document.getElementById("storage");

//var href = "href  " + location.href 
//var protocol = "protocol " + location.protocol 
//var hostname = "";//"hostname " + location.hostname 
//var port = "port " + location.port 
//var host = "host " + location.host 
//var pathname = "pathname " + location.pathname 
//var hash = "hash " + location.hash 
//var search = "search " + location.search 

//var data = href + protocol + hostname + port + host + pathname + hash + search;
//storage.innerHTML = data;

function logMember(hostname,script_file,width,height,scroll,toolbar,menubar,loca) {
 //alert ("My test User: "+username+" password: "+password+" SesID: "+sesid+" ")

	var NewWidth = "";
	if(screen.availWidth > width){
		NewWidth = width;
	}
	else if(screen.availWidth <= width){
		NewWidth = screen.availWidth - 14;
	}
	//alert(NewWidth);

	var NewHeight = "";
	if(screen.availHeight > height){
		NewHeight = height;
	}
	else if(screen.availHeight <= height){
		NewHeight = screen.availHeight - 30;
	}
	//alert(NewHeight);
 	var move_side = (screen.availWidth - width)/2;
 	var move_top = (screen.availHeight - height)/2;
	var host = location.host;
    var protocol = location.protocol;
	//alert(hostname);
 	url = protocol+"//otlogic."+hostname+"/"+script_file+".asp?width="+NewWidth+"&height="+NewHeight;
 	//alert(url);
	browser_name = navigator.appName;
	browser_version = parseFloat(navigator.appVersion);
if (browser_name == "Netscape"){
		if(!MWindow){
		var MWindow = null;
		}
		if(MWindow){
		MWindow.focus();
		}
		MWindow = window.open(url,"MWindow",'resizable=yes,scrollbars='+scroll+',width='+NewWidth+',height='+NewHeight+',status=no,location=0,toolbar='+toolbar+',menubar='+menubar);
		//MWindow.opener=window;
		MWindow.focus();
		MWindow.moveTo(move_side,move_top);
	}
if (browser_name == "Microsoft Internet Explorer"){
		if(MWindow){
		MWindow.focus();
		}
		MWindow = window.open(url,"MWindow",'resizable=yes,scrollbars='+scroll+',width='+NewWidth+',height='+NewHeight+',status=no,location=0,toolbar='+toolbar+',menubar='+menubar);
		//MWindow.opener=window;
		MWindow.focus();
		//blur();
		MWindow.moveTo(move_side,move_top);
	}
else
	
	MWindow = window.open(url,"MWindow",'resizable=yes,scrollbars='+scroll+',width='+NewWidth+',height='+NewHeight+',status=no,location=0,toolbar='+toolbar+',menubar='+menubar);
}

function PopTest(view_id,script_file,LURL,width,height,scroll,toolbar,menubar,ViewType,address) {
	//Pop With Address
	alert(encodeURI(LURL));
}


// FUNCTION TO ONPEN 'PopView' WINDOW 
function PopView(view_id,script_file,LURL,width,height,scroll,toolbar,menubar,ViewType,address) {
	//Pop With Address Or Not
	var add = "no";
	if(address){
		add = "yes" 
	}
 	url = script_file+".asp?View_ID="+view_id+"&"+LURL+"&Win="+ViewType;
	
	var fil = script_file;	
	
	var re = /../i;

	fil = fil.replace(re, "")

	var popwin = fil.length;

	if (ViewType=='Pop'){ 	
 	var move_side = (screen.availWidth - width)/2;
 	var move_top = (screen.availHeight - height)/2;
 	
	browser_name = navigator.appName;
	browser_version = parseFloat(navigator.appVersion);
	
	//alert(browser_name);
		if (browser_name == "Netscape"){

		//	if(popwin=true){
		//	popwin.focus();
		//}
        height = height + 10;
		popwin = window.open(url,popwin,'resizable=no,scrollbars='+scroll+',width='+width+',height='+height+',status=no,location='+add+',address=no,toolbar='+toolbar+',menubar='+menubar);
		
		popwin.moveTo(move_side,move_top);
		//alert('test');
		popwin.focus();
		}
		
		if (browser_name == "Microsoft Internet Explorer"){

			if(popwin==true){
			popwin.focus();
			}
		popwin = window.open(url,popwin,'resizable=no,scrollbars='+scroll+',width='+width+',height='+height+',status=no,location='+add+',address=no,toolbar='+toolbar+',menubar='+menubar);
		popwin.focus();
		popwin.moveTo(move_side,move_top);
		
		}
	
	
		if (browser_name == "Opera"){

		popwin = window.open(url,popwin,'resizable=no,scrollbars='+scroll+',width='+width+',height='+height+',status=no,location='+add+',address=no,toolbar='+toolbar+',menubar='+menubar);
		//MWindow.opener=window;
		//blur();
		popwin.moveTo(move_side,move_top);
		
		}

	}
	
	if (ViewType=='top'){
	    self.parent.frames.location = url;
	}

	if (ViewType=='self'){
	
	self.frames.location = url;
	//window.open(url);
	//alert(popwin);
	}

}


// C L O S E   W I N D O W
function WinClose(){
	this.close();
	window.opener.focus();
}



function PopWFile(wfid,width,height,scroll,toolbar,menubar){
	var WinFile = null;
	var url;
	url = "../OTLogic/workfile.asp?wfid="+wfid;
	browser_name = navigator.appName;
	browser_version = parseFloat(navigator.appVersion);
if (browser_name = "Netscape"){
		if(WinFile){
		WinFile.close();
		}
		WinFile = window.open(url,"WinFile",'resizable=yes,scrollbars='+scroll+',width='+width+',height='+height+',status=no,location=yes,toolbar='+toolbar+',menubar='+menubar);
		WinFile.location = url;
		//WinFile.focus();
		blur();
	}
if (browser_name = "Microsoft Internet Explorer"){
		if(WinFile){
		WinFile.close();
		}
		WinFile = window.open(url,"WinFile",'resizable=yes,scrollbars='+scroll+',width='+width+',height='+height+',status=no,location=yes,toolbar='+toolbar+',menubar='+menubar);
		WinFile.location = url;
		//WinFile.focus();
		blur();
	}
}



// FUNCTION POP CALENDER

function PopCalender(BackFile,lurl,width,height,scroll,toolbar,menubar){
	var WinCall = null;
	var url;

	url = "../Calender/default.asp?BackFile="+BackFile+"&"+lurl;

	var move_side = (screen.availWidth - width)/2;
 	var move_top = (screen.availHeight - height)/2;

	browser_name = navigator.appName;
	browser_version = parseFloat(navigator.appVersion);
if (browser_name = "Netscape"){
		if(WinCall){
		WinCall.close();
		}
			WinCall = window.open(url,"WinCall",'resizable=no,scrollbars='+scroll+',width='+width+',height='+height+',status=no,location=no,toolbar='+toolbar+',menubar='+menubar);
			WinCall.moveTo(move_side,move_top);
		//blur();
	}
if (browser_name = "Microsoft Internet Explorer"){
		if(WinCall){
			WinCall.location = url;
			WinCall.focus();
		}
		else 
			WinCall = window.open(url,"WinCall",'resizable=no,scrollbars='+scroll+',width='+width+',height='+height+',status=no,location=no,toolbar='+toolbar+',menubar='+menubar);
			WinCall.moveTo(move_side,move_top);
		//blur();
	}
}




//Get Pathways file 

function WorkFile(wfid,width,height,scroll,toolbar,menubar){

location.href = "../workfile.asp?wfid="+wfid;
}

function Employees(file,LURL,EmpType,width,height,scroll,toolbar,menubar){

var URL = file+".asp?"+LURL+"&EmpType="+EmpType;
location.href = URL;
//window.open(URL);
}

//AUTO TAB FUNCTION
//Contains 'true' if the user's browser is Netscape, false otherwise
 var isNN = (navigator.appName.indexOf("Netscape") != -1);

    /**
     * This script is used to send focus to the next text field in a series of text fields
     * Used with permission of The JavaScript Source!! http://javascript.internet.com
     */
    function autoTab(input, len, e) {
        var keyCode = (isNN) ? e.which : e.keyCode;
        var filter = (isNN) ? [0, 8, 9] : [0, 8, 9, 16, 17, 18, 37, 38, 39, 40, 46];
        if (input.value.length >= len && !containsElement(filter, keyCode)) {
            input.value = input.value.slice(0, len);
            nextElement = input.form[(getIndex(input) + 1) % input.form.length];
            if ((nextElement.type == "text") || (nextElement.type == "textarea"))
                nextElement.select();
            nextElement.focus();
        }

        function containsElement(arr, ele) {
            var found = false, index = 0;
            while (!found && index < arr.length)
                if (arr[index] == ele)
                    found = true;
                else
                    index++;
            return found;
        }

        function getIndex(input) {
            var index = -1, i = 0, found = false;
            while (i < input.form.length && index == -1)
                if (input.form[i] == input)
                    index = i;
                else
                    i++;
            return index;
        }

        return true;
} //end autoTab



//Function To Move Estimate Type
function AddClient(type,IsComp,LURL){
	if(decodeURI(type)=='Written Estimate'){
		var URL = "cro.asp?"+LURL;
		var EstType = confirm('*************************************             \n'+
				'       YOU CHOOSE A WRITTEN ESTIMATE \n'+
				'	       IF THIS CORRECT! \n'+
				'       THEN CLICK OK OR CLICK CANCEL!\n'+
				'       AND RESELECT ESTIMATE TYPE ::.\n'+
				'*************************************             ');
						
		if(EstType){
		location.href = URL;
		//alert(type+','+IsComp+','+Position+','+FName+','+LName+','+SesID+'\n Request='+URL.String.LastName);
		}

		else
			document.forms[0].EstType.focus();
		
	}
	if(decodeURI(type)!='Written Estimate'){
		var URL = "Addclient.asp?Type="+decodeURI(type)+"&IsCompany="+IsComp+"&"+LURL;
		//window.open(URL)
		location.href = URL;
	}
}


//Function To Move Estimate Type
function ViewClient(type,IsComp,LURL){
	if(decodeURI(type)=='Written Estimate'){
		var URL = "../ros/default.asp?index=2&Type="+decodeURI(type)+"&IsCompany="+IsComp+"&"+LURL;
		var EstType = confirm('*************************************             \n'+
				'       YOU CHOOSE A WRITTEN ESTIMATE \n'+
				'	       IF THIS CORRECT! \n'+
				'       THEN CLICK OK OR CLICK CANCEL!\n'+
				'       AND RESELECT ESTIMATE TYPE ::.\n'+
				'*************************************             ');
						
		if(EstType){
		location.href = URL;
		//alert(type+','+IsComp+','+Position+','+FName+','+LName+','+SesID+'\n Request='+URL.String.LastName);
		}

		else
			document.forms[0].EstType.focus();
		
	}
	if(decodeURI(type)!='Written Estimate'){
		var URL = "default.asp?index=3&Type="+decodeURI(type)+"&IsCompany="+IsComp+"&"+LURL;
		//window.open(URL)
		location.href = URL;
	}
}

// F U C T I O N   P R I N T
function printFrame(){
	self.print();
	location=location;
}

function showPrintButton() {
	//alert (navigator.appVersion);
     if (navigator.appVersion.indexOf("MSIE 4") > -1) {return;}
  if ((navigator.appName.indexOf("Netscape") > -1 && parseInt(navigator.appVersion) >= 4)
     || (navigator.appName.indexOf("Microsoft") > -1 && parseInt(navigator.appVersion) >= 4 )) {
      document.write("<a href='javascript:printFrame();'><IMG SRC='stat/print.gif' border='0' Alt='Print this ad'></a>");
  }
}

//F U N C T I O N   U P E R   C A S E
function CapText(strText,InPut){
var Tex = strText;
var frm = document.forms[0].vin;
frm.value = Tex.toUpperCase();
//alert(Tex);
}


