﻿	<!-- Begin
	/* This script and many more are available free online at
	The JavaScript Source!! http://javascript.internet.com
	Created by: Ultimater :: http://ultimiacian.tripod.com/
	Add this snippet to the very beginning of your script. */

	if(!document.getElementById){
	if(document.all)
	document.getElementById=function(){
		if(typeof document.all[arguments[0]]!="undefined")
		return document.all[arguments[0]]
		else
		return null
	}
	else if(document.layers)
	document.getElementById=function(){
		if(typeof document[arguments[0]]!="undefined")
		return document[arguments[0]]
		else
		return null
	}
	}
	// End -->

	browserName=navigator.appName;
	browserVer=parseInt(navigator.appVersion);
	
	if (browserVer > 2) {
	
	Company_R = new Image(109, 37);
	Company_R.src="images/Company_R.jpg";
	Company_O = new Image(109, 37);
	Company_O.src="images/Company_O.jpg";	
	Company_C = new Image(109, 37);
	Company_C.src="images/Company_C.jpg";		

	Restoration_R = new Image(143, 37);
	Restoration_R.src="images/Restoration_R.jpg";
	Restoration_O = new Image(143, 37);
	Restoration_O.src="images/Restoration_O.jpg";	
	Restoration_C = new Image(143, 37);
	Restoration_C.src="images/Restoration_C.jpg";	
	
	Resolution_R = new Image(133, 37);
	Resolution_R.src="images/Resolution_R.jpg";
	Resolution_O = new Image(133, 37);
	Resolution_O.src="images/Resolution_O.jpg";		
	Resolution_C = new Image(133, 37);
	Resolution_C.src="images/Resolution_C.jpg";		
	
	Education_R = new Image(127, 37);
	Education_R.src="images/Education_R.jpg";
	Education_O = new Image(127, 37);
	Education_O.src="images/Education_O.jpg";	
	Education_C = new Image(127, 37);
	Education_C.src="images/Education_C.jpg";	
		
	Contact_R = new Image(105, 37);
	Contact_R.src="images/Contact_R.jpg";
	Contact_O = new Image(105, 37);
	Contact_O.src="images/Contact_O.jpg";		
	Contact_C = new Image(105, 37);
	Contact_C.src="images/Contact_C.jpg";		
	
	Home_R = new Image(173, 37);
	Home_R.src="images/Home_R.jpg";
	Home_O = new Image(173, 37);
	Home_O.src="images/Home_O.jpg";	
	
    Home_Text = new Image(631, 51);
	Home_Text.src="images/HmPgTitle.jpg";	
    Title_Text = new Image(631, 51);
	Title_Text.src="images/HmPgTitle.jpg";		
    Company_Text = new Image(631, 51);
	Company_Text.src="images/Company_Text.gif";	
	Restoration_Text = new Image(631, 51);
	Restoration_Text.src="images/Restoration_Text.gif";	
	Resolution_Text = new Image(631, 51);
	Resolution_Text.src="images/Resolution_Text.gif";	
	Education_Text = new Image(631, 51);
	Education_Text.src="images/Education_Text.gif";	
	Contact_Text = new Image(631, 51);
	Contact_Text.src="images/Contact_Text.gif";	
	
	DashImg = new Image(17, 12);
	DashImg.src="images/SideNavDash.gif";
	ClearImg = new Image(17, 12);
	ClearImg.src="images/Clear.gif";
	
	CopyArrow_R = new Image(10, 9);
	CopyArrow_R.src="images/CopyArrow_R.gif";
	CopyArrow_O = new Image(10, 9);
	CopyArrow_O.src="images/CopyArrow_O.gif";	

	Spl_Gunns_2_R = new Image(441, 29);
	Spl_Gunns_2_R.src="images/Spl_Gunns_2_R.gif";
	Spl_Gunns_2_O = new Image(441, 29);
	Spl_Gunns_2_O.src="images/Spl_Gunns_2_O.gif";		
	
	Spl_EA_2_R = new Image(450, 29);
	Spl_EA_2_R.src="images/Spl_EA_2_R.gif";
	Spl_EA_2_O = new Image(450, 29);
	Spl_EA_2_O.src="images/Spl_EA_2_O.gif";			
		
}
	
	function Dash_Roll(imgName) {
		var el = document.getElementById(imgName);
		if (el != null) {
				el.src = DashImg.src;
		}
	}
		
	function Dash_UnRoll(imgName) {
		var el = document.getElementById(imgName);
		if (el != null) {
				el.src = ClearImg.src;
		}

	}		
	
	var _OneToIgnore = '';
	
	function PreRollIt(imgName) {
        var el = document.getElementById(imgName);
        if ( el != null ) { el.src = eval(imgName + "_C.src"); }
	
    }	
	
	function RollIt(imgName) {
	    if ( imgName != _OneToIgnore ) {
		    var el = document.getElementById(imgName);
		    el.src = eval(imgName + "_O.src");
		    var el = document.getElementById('imgTitle');
		    if (el != null ) { 	el.src = eval(imgName + "_Text.src"); }		    
		}

		
    }
	
	function UnRollIt(imgName) {
	    if ( imgName != _OneToIgnore ) {
		    var el = document.getElementById(imgName);
		    el.src = eval(imgName + "_R.src");
            var el = document.getElementById('imgTitle');
            if ( el != null ) { el.src = Title_Text.src; }		    
		}

	}
	
	function RollIt_v2(imgName, DDFS, GorJ) {
	
		var el = document.getElementById(imgName);
		var img = new Image();
		img.src ='images/' + imgName + '_O.' + GorJ;
		el.src = img.src;
	}
	
	function UnRollIt_v2(imgName, DDFS, GorJ) {
	
		var el = document.getElementById(imgName);
		var img = new Image();
		img.src = 'images/' + imgName + '_R.' + GorJ;
		el.src = img.src;
		
	}	
	
	
	
	function LinkRoll(imgName) {
	    var el = document.getElementById(imgName);
	    el.src = CopyArrow_O.src;	
    }
	
    function LinkUnRoll(imgName) {
	        var el = document.getElementById(imgName);
	        el.src = CopyArrow_R.src;	
        }	
        
    function SetLeftRightColumnsMain() {

            var myWidth = 0, myHeight = 0, myLeft = 0, myRight = 0;
            var el;
            var left,top,html,el2;
                
            if (typeof (window.innerWidth) == 'number') {
                //Non-IE
                myWidth = window.innerWidth;
                myHeight = window.innerHeight;
            } else if (document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) {
                //IE 6+ in 'standards compliant mode'
                myWidth = document.documentElement.clientWidth;
                myHeight = document.documentElement.clientHeight;
            } else if (document.body && (document.body.clientWidth || document.body.clientHeight)) {
                //IE 4 compatible
                myWidth = document.body.clientWidth;
                myHeight = document.body.clientHeight;
            }

            myWidth = myWidth - 800;
            myLeft = myWidth / 2;
            myRight = myLeft;
            
            if (myLeft < 75 ) { myLeft = 75 }
            if (myRight < 75 ) { myRight = 75 }

            el = document.getElementById('imgMain_Top_Left');
            el.style.width = myLeft + 'px';
            el = document.getElementById('imgMain_Top_Right');
            el.style.width = myRight + 'px';
            
            // move the floating tag on the home page
            if ( location.href.indexOf('Default2.aspx') > 0 ) {
            
                // find the position of our imgTitle
                el = document.getElementById('imgTitle');
                if (el != null) {
                     t = findPos(el);
                     left = parseInt(t[0]);
                     top = parseInt(t[1]);
                }  
                else {
                    left = 100;  
                    top = 100; 
                }       
                
                // move the Floating tag layer relative to that
                left = left - 144;
                top = top + 110;
                left = String(left) + 'px';
                top = String(top) + 'px';
                
                // show the pic layer
                el2 = document.getElementById('divFloatingTag');
	            el2.style.left = left; 
	            el2.style.top = top;            
            }
            
            var tmr444 = setTimeout('MoveFloatingLink()', 500);

        }
       
        
function MoveFloatingLink() {

            var el;
            var left,top,html,el2;

            // move the floating info link
            el = document.getElementById('imgMid_Col_Footer_Piece2');
            if ( el != null ) {
            
                // find the position of our imgTitle
                if (el != null) {
                     t = findPos(el);
                     left = parseInt(t[0]);
                     top = parseInt(t[1]);
                }  
                else {
                    left = 100;  
                    top = 100; 
                }       
                
                // move the Floating tag layer relative to that
                left = left + 554;
                top = top + 30;
                left = String(left) + 'px';
                top = String(top) + 'px';
                
                // show the pic layer
                el2 = document.getElementById('divInfoLinkRed');
	            el2.style.left = left; 
	            el2.style.top = top;            
            }

            // move the floating info link on home page
            el = document.getElementById('imgMid_Col_Footer_Piece');
            if ( el != null ) {
            
                // find the position of our imgTitle
                if (el != null) {
                     t = findPos(el);
                     left = parseInt(t[0]);
                     top = parseInt(t[1]);
                }  
                else {
                    left = 100;  
                    top = 100; 
                }       
                
                // move the Floating tag layer relative to that
                left = left + 554;
                top = top + 30;
                left = String(left) + 'px';
                top = String(top) + 'px';
                
                // show the pic layer
                el2 = document.getElementById('divInfoLink');
	            el2.style.left = left; 
	            el2.style.top = top;            
            }            


}
       

function findPos(obj) {
	var curleft = curtop = 0;
	if (obj.offsetParent) {
		curleft = obj.offsetLeft
		curtop = obj.offsetTop
		while (obj = obj.offsetParent) {
			curleft += obj.offsetLeft
			curtop += obj.offsetTop
		}
	}
	return [curleft,curtop];
}


var Pic = new Array()

Pic[0] = 'images/HmPg_Slide1.jpg'; 
Pic[1] = 'images/HmPg_Slide2.jpg'; 
Pic[2] = 'images/HmPg_Slide3.jpg'; 
Pic[3] = 'images/HmPg_Slide4.jpg'; 
Pic[4] = 'images/HmPg_Slide5.jpg'; 
Pic[5] = 'images/HmPg_Slide6.jpg'; 
Pic[6] = 'images/HmPg_Slide7.jpg'; 
Pic[7] = 'images/HmPg_Slide8.jpg'; 
Pic[8] = 'images/HmPg_Slide9.jpg'; 
Pic[9] = 'images/HmPg_Slide10.jpg'; 

var t
var j = 0
var p = Pic.length
var preLoad = new Array()
for (i = 0; i < p; i++)
{
preLoad[i] = new Image()
preLoad[i].src = Pic[i]
}

var Pic_tmr1;	
var Pic_Cnt1 = 0;
var Pic_Op1 = 100;
var Pic_HeadingCnt = 1;

navigator.appName.indexOf

function Rotate_Pics() {

    	Pic_Cnt1 = Pic_Cnt1 + 1;
		if (Pic_Cnt1 > 24) {
			var el = document.getElementById('imgHmPg_Slide');
			if (el != null) {
				// fade the image out
				if (Pic_Cnt1 < 40) {
					Pic_Op1 = Pic_Op1 - 7;
					if (navigator.appName.indexOf("Microsoft") != -1) { el.filters.alpha.opacity = Pic_Op1 }
						else { el.style.MozOpacity = Pic_Op1/100; el.style.opacity = Pic_Op1/100; }
					}
				// swap the image back to orig
				if (Pic_Cnt1 == 41 ) { el.src = preLoad[Pic_HeadingCnt].src }
				// fade the image back in
				if (Pic_Cnt1 > 42) {
					Pic_Op1 = Pic_Op1 + 7;
					if (navigator.appName.indexOf("Microsoft") != -1) { el.filters.alpha.opacity = Pic_Op1 }
						else { el.style.MozOpacity = Pic_Op1/100; el.style.opacity = Pic_Op1/100;  }
					}				
				}
			}
		if (Pic_Cnt1 > 57) {
			clearTimeout(Pic_tmr1);
			Pic_Cnt1 = 0;
			Pic_Op1 = 100;
			Pic_HeadingCnt = Pic_HeadingCnt + 1;
			if (Pic_HeadingCnt > 9) { Pic_HeadingCnt = 0 }
		}
		
		if ( Pic_Cnt1 < 24 ) {
		    Pic_tmr1 = setTimeout('Rotate_Pics()', 250);
		}
		else {
		    Pic_tmr1 = setTimeout('Rotate_Pics()', 50);
		}
			
		
}

function SubmitRegisterForm() {

    var el;
    
    el = FindMyControl('txtFirst_Name');
    if ( el.value.length <= 1 ) { alert('First Name is a required field in order to register.  Please go back and provide a value for this item.'); return; }
    el = FindMyControl('txtLast_Name');
    if ( el.value.length <= 1 ) { alert('Last Name is a required field in order to register.  Please go back and provide a value for this item.'); return; }
    el = FindMyControl('txtTitle');
    if ( el.value.length <= 1 ) { alert('Title is a required field in order to register.  Please go back and provide a value for this item.'); return; }        
    el = FindMyControl('txtEmail');
    if ( el.value.length <= 4 ) { alert('Email is a required field in order to register.  Please go back and provide a value for this item.'); return; }            
    el = FindMyControl('txtPhone');
    if ( el.value.length <= 4 ) { alert('Phone is a required field in order to register.  Please go back and provide a value for this item.'); return; }                
    el = FindMyControl('txtCity');
    if ( el.value.length <= 2 ) { alert('City is a required field in order to register.  Please go back and provide a value for this item.'); return; }                    
    el = FindMyControl('selCourse');
    //if ( el.selectedIndex == 0 ) { alert('Course is a required field in order to register.  Please go back and provide a value for this item.'); return; }                    
    el = FindMyControl('selCourseTime');
    //if ( el.value.length <= 4 ) { alert('Course date/time is a required field in order to register.  Please go back and provide a value for this item.'); return; }                
        
    el.form.submit();
    
}

function SubmitFileAClaimForm() {

    var el;
    
    el = FindMyControl('txtFC_MyName');
    if ( el.value.length <= 1 ) { alert('The name field is a required field in order to file a claim.  Please go back and provide a value for this item.'); return; }
        
    el.form.submit();
}

function FindMyControl(MyID) {

	var frmElements,i,t,ctl;
	
	// Since the use of master pages mangles the names of child controls, we need a method 
	// of searching through the form elements and returning a reference to the control we are 
	// looking for that control by the name we know it as instead of the dumb-ass name ASP.Net creates.
	// First scan through all of the input elements and look for our control
    frmElements=document.getElementsByTagName('input');
    for(i in frmElements)
    {
        t = String(frmElements[i].id); 
        t = '_' + t;
        if (t.indexOf(MyID) > -1 )
            { return frmElements[i] }
    }
   // Still not found, scan through all of the select elements
    frmElements=document.getElementsByTagName('select');
    for(i in frmElements)
    {
        t = String(frmElements[i].id); 
        t = '_' + t;
        if (t.indexOf(MyID) > -1 )
            { return frmElements[i] }
    } 
   
   // Still not found, scan through all of the textarea elements
    frmElements=document.getElementsByTagName('textarea');
    for(i in frmElements)
    {
        t = String(frmElements[i].id); 
        t = '_' + t;
        if (t.indexOf(MyID) > -1 )
            { return frmElements[i] }
    }   
   
   // Still not found, scan through all of the iframe elements
    frmElements=document.getElementsByTagName('td');
    for(i in frmElements)
    {
        t = String(frmElements[i].id); 
        t = '_' + t;
        if (t.indexOf(MyID) > -1 )
            { return frmElements[i] }
    }         
   
   // Still not found, scan through all of the iframe elements
    frmElements=document.getElementsByTagName('iframe');
    for(i in frmElements)
    {
        t = String(frmElements[i].id); 
        t = '_' + t;
        if (t.indexOf(MyID) > -1 )
            { return frmElements[i] }
    }         
   
  return false;  

}


function CopyOver(coType) {

    var el;
    var t;

    if ( coType == 'Adjuster') {
        el = FindMyControl('txtFC_MyName');
        t = el.value;
        el = FindMyControl('txtFC_AdjName');
        el.value = t;
        el = FindMyControl('txtFC_MyPhone');
        t = el.value;
        el = FindMyControl('txtFC_AdjPhone');
        el.value = t;        
        el = FindMyControl('txtFC_MyEmail');
        t = el.value;
        el = FindMyControl('txtFC_AdjEmail');
        el.value = t;            
    }
    
    if ( coType == 'Insured') {
        el = FindMyControl('txtFC_MyName');
        t = el.value;
        el = FindMyControl('txtFC_InsName');
        el.value = t;
        el = FindMyControl('txtFC_MyPhone');
        t = el.value;
        el = FindMyControl('txtFC_InsPhone');
        el.value = t;        
        el = FindMyControl('txtFC_MyEmail');
        t = el.value;
        el = FindMyControl('txtFC_InsEmail');
        el.value = t;            
    }    

}

function SetFooterHeight() {

    var el;
    var newHeight;
    var myWidth = 0, myHeight = 0;
    var left,top,t;
    
    if( typeof( window.innerWidth ) == 'number' ) {
        //Non-IE
        myWidth = window.innerWidth;
        myHeight = window.innerHeight;
      } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
        //IE 6+ in 'standards compliant mode'
        myWidth = document.documentElement.clientWidth;
        myHeight = document.documentElement.clientHeight;
      } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
        //IE 4 compatible
        myWidth = document.body.clientWidth;
        myHeight = document.body.clientHeight;
      }
      
    el = document.getElementById('imgMarker');
    t = findPos(el);
    left = parseInt(t[0]);
    top = parseInt(t[1]);
    
    if ( top < myHeight ) {
        el = document.getElementById('divFooter1'); 
        if ( el == null ) { el = document.getElementById('divFooter2');   }
        newHeight = ( myHeight - top ) + 20;
        el.style.height = newHeight + 'px';
    }

}
