	<!-- 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) {
	
	DashImg = new Image(8, 8);
	DashImg.src="http://www.cmc.com/images/SideNavDash.gif";
	ClearImg = new Image(8, 8);
	ClearImg.src="http://www.cmc.com/images/Clear.gif";
	
	FlashDashImg = new Image(16, 16);
	FlashDashImg.src="http://www.cmc.com/images/FlashMaps_Dash.gif";
	FlashClearImg = new Image(16, 16);
	FlashClearImg.src="http://www.cmc.com/images/Clear.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;
		}

	}		
	
	function Flash_Dash_Roll(imgName) {
		var el = document.getElementById(imgName);
		if (el != null) {
				el.src = FlashDashImg.src;
		}
	}
		
	function Flash_Dash_UnRoll(imgName) {
	
        el = document.getElementById('hdActive');
		if (el.value == imgName ) { return }
		
		var el = document.getElementById(imgName);
		if (el != null) {
				el.src = FlashClearImg.src;
		}

	}		
	
	
	function RollIt(imgName) {
		var el = document.getElementById(imgName);
		el.src = eval(imgName + "_O.src");
	}
	
	function UnRollIt(imgName) {
		var el = document.getElementById(imgName);
		el.src = eval(imgName + "_R.src");
	}
	
	function RollIt_v2(imgName, DDFS, GorJ) {
	
		var el = document.getElementById(imgName);
		var img = new Image();
		img.src = DDFS + '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 = DDFS + 'images/' + imgName + '_R.' + GorJ;
		el.src = img.src;
		
	}	
	
	
	function addToFavorites(URL, PageName) 
	{ 
		if (window.external) { window.external.AddFavorite(URL,PageName) } 
		else { alert("Sorry! Your browser doesn't support this function."); } 
	}	
	
	function PrintToHTML(Link) {
		var w = window.open(Link, 'PrintToHTML', 'width=625,height=475,directories=no,location=no,menubar=no,resizable=yes,scrollbars=yes,status=no,toolbar=no,top=20,left=20');
		w.focus();
	}		
	
	function EmailPage(Link) {
		var Loc = "EmailPage.aspx?Link=" + escape(Link)
		var w = 	window.open(Loc, 'EmailPage', 'width=350,height=420,directories=no,location=no,menubar=no,resizable=no,scrollbars=no,status=no,toolbar=no,top=100,left=100');
		w.focus();
	}	
	
	function NewWin(Link) {
		var w = 	window.open(Link, 'NewWin');
		w.focus();
	}			

	  
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 textarea 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 textarea elements
    frmElements=document.getElementsByTagName('img');
    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('div');
    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 PositionLayer(LayerName, OffSetX, OffSetY) {

	var imgX;
	var imgY;
	var MyScrollTop;
	var el;
	
	el = document.getElementById(LayerName);
	
	if (OffSetX == 450 ) { OffSetX = 325 }		// correction
	if (navigator.appVersion.indexOf('MSIE 7') > -1) { OffSetY = OffSetY + 20 } // correct for IE 7
	
	imgX = (document.body.clientWidth / 2);	// find the center of the window
	imgX = imgX - OffSetX
	imgY = OffSetY;
	// adjust for scroll position
	if (document.documentElement && !document.documentElement.scrollTop)   // IE6 +4.01 but no scrolling going on
        { MyScrollTop = 0 }    
    else if (document.documentElement && document.documentElement.scrollTop)  // IE6 +4.01 and user has scrolled
        { MyScrollTop = document.documentElement.scrollTop }   
    else if (document.body && document.body.scrollTop) // IE5 or DTD 3.2
        { MyScrollTop = document.body.scrollTop }   
	imgY = imgY + MyScrollTop;
	
	imgX = parseInt(imgX);
	imgY = parseInt(imgY);
	
	el.style.left = imgX + 'px'; 
	el.style.top = imgY + 'px'; 
}

function ShowLayer(LayerName) {		

	// determine our browser type for layer usage, since Netscape is 6 is the devil in disguise
	var BrowserType = "";
	if(document.layers) { BrowserType="NN4" }
	if(document.all) { BrowserType="IE"  }
	if(!document.all && document.getElementById) { BrowserType="NN6" } // what is Netscape smoking????
	if (BrowserType=="") { BrowserType="IE"  }	// default to IE, just because....

	if (BrowserType=="IE") { document.all[LayerName].style.visibility = 'visible' }
	if (BrowserType=="NN4") { document.layers[LayerName].visibility = 'visible' }
	if (BrowserType=="NN6") { document.getElementById(LayerName).style.visibility='visible' }
	
}

function CancelLayer(LayerName) {

	// determine our browser type for layer usage, since Netscape is 6 is the devil in disguise
	var BrowserType = "";
	if(document.layers) { BrowserType="NN4" }
	if(document.all) { BrowserType="IE"  }
	if(!document.all && document.getElementById) { BrowserType="NN6" } // what is Netscape smoking????
	if (BrowserType=="") { BrowserType="IE"  }	// default to IE, just because....

	if (BrowserType=="IE") { parent.document.all[LayerName].style.visibility = 'hidden' }
	if (BrowserType=="NN4") { parent.document.layers[LayerName].visibility = 'hidden' }
	if (BrowserType=="NN6") { parent.document.getElementById(LayerName).style.visibility='hidden' }
}	


function Validate_Register_Form() {

    var OkToGo = true;
   
   if (OkToGo && document.forms[0].txtName.value.length < 2) 
        { OkToGo = false; alert('A valid name is required to continue.  Please enter a valid name.'); }   
        
   if (OkToGo && document.forms[0].txtCompany.value.length < 2) 
        { OkToGo = false; alert('A valid company is required to continue.  Please enter a valid company.'); }        

   if (OkToGo && document.forms[0].txtEmail.value.length < 2) 
        { OkToGo = false; alert('A valid email is required to continue.  Please enter a valid email.'); }        
   
   if (OkToGo)
        { document.forms[0].submit(); }  

}

function Change_PS_Radio_Selection(sel) {

    var el;
    var imgChecked;
    var imgUnchecked;  
    
   	imgChecked = new Image(20, 23);
	imgChecked.src="images/PS_Radio_Checked.gif";  
	imgUnchecked = new Image(20, 23);
	imgUnchecked.src="images/PS_Radio_Unchecked.gif";  
   
    // set each radio to unchecked 
    el = FindMyControl('imgBuy');
    el.src = imgUnchecked.src;
    el = FindMyControl('imgSell');
    el.src = imgUnchecked.src;
    el = FindMyControl('imgBroker');
    el.src = imgUnchecked.src;    
   
    // based on passed in selection set to checked
    if (sel == 'Buy') {
        el = FindMyControl('imgBuy');
        el.src = imgChecked.src;
    } 
    if (sel == 'Sell') {
        el = FindMyControl('imgSell');
        el.src = imgChecked.src;
    } 
    if (sel == 'Broker') {
        el = FindMyControl('imgBroker');
        el.src = imgChecked.src;
    }   
    
    // set hidden form element to selection
   el = FindMyControl('hdPS_Buy_Sell_Broker');
   el.value = sel   

}

function validate_email_alert_form() {

    var email;
    
    email = document.forms[0].subscriber_email.value;
    if ( validEmail(email) == false ) 
        { alert('You must provide a valid email address to subscribe.'); return; } 
   
    document.forms[0].submit();
}

function validEmail(email) 
{
     var invalidChars = " /:,;"; // NOTE - first char is a SPACE

     for (i = 0;  i < invalidChars.length; i++) { // does it contain any invalid characters?
          var badChar = invalidChars.charAt(i);
          if (email.indexOf(badChar, 0) > -1) return false;
     }

     var atPos = email.indexOf("@", 1);  // there must be one "@" symbol
     if (atPos == -1) return false;
     // and only one "@" symbol
     if (email.indexOf("@", atPos + 1) != -1) return false;

     periodPos = email.indexOf(".", atPos);
     // and at least one "." after the "@"
     if (periodPos == -1) return false;
     // must be at least 2 characters after the "."
     if (periodPos + 3 > email.length)  return false;

     return true;
}

function ShowAnswer(Id) {

    var el;
   
    el = document.getElementById('A' + Id);
    if ( el.style.visibility == 'visible' )  
        {  el.style.visibility = 'hidden'; el.style.position = 'fixed';}
    else 
        { el.style.visibility = 'visible'; el.style.position = 'relative'; } 
 
}

    function LaunchSite(sel) {
           var URL;  
           if (sel.selectedIndex > 0) {
            URL = sel[sel.selectedIndex].value;
            if (URL.indexOf('http') <= 0) { URL = 'http://' + URL }
            window.open(URL, 'OtherSite');
        }            
    } 
   
function Validate_Request_Form () {

    var el = document.getElementById('txtEmail');
    
   if ( validEmail(el.value) )
        { el.form.submit(); }
   else
        { alert('A valid email is required to request information.  Please double check the email address you have provided.'); }
}    






// ----- Saving Calculator Scripts
function calc()
{
            var i;
            var APR = CleanFloatStr(document.forms[0].APR.value);
            document.forms[0].APR.value = APR;
            
            // get percentage
            if (isNaN(APR))
            {
                        alert("Error!");
                        return;
            }
            APR = APR/100;
            
            // get amount
            var amnt = CleanNumStr(document.forms[0].Amnt.value);
            amnt = parseInt(amnt);
            if (isNaN(amnt))
            {
                        alert("Incorrect amount value");
                        document.forms[0].Amnt.value = "0";
                        return;

            }
            document.forms[0].Amnt.value = FmtNumStr(amnt);
            
            // cp = payments per year
            var cp = document.forms[0].CP.options[document.forms[0].CP.selectedIndex].value;
            if (isNaN(cp))
            {
                        alert("Error!");
                        return;

            }
            
            // TP = contribution period
            // get amount
            var TP = CleanNumStr(document.forms[0].TP.value);
            TP = parseInt(TP);
            if (isNaN(TP))
            {
                        alert("Incorrect contribution period value");
                        document.forms[0].TP.value = "0";
                        return;

            }
            document.forms[0].TP.value = TP;
            

            // OK we have got everything
            
            // per interest rate K = APR / Payments per year = APR/cp
            var K = APR/cp;
            
            // number of payments = N = (Paym per year/12 month)*Loan period in months
            var N = parseInt((cp/12)*TP);
            //document.forms[0].NPMT.value = N;
            
            // FVIFA = (POWER(1+K, N) - 1)/K
            var FVIFA = Math.pow(1+K,N)/K - 1/K;
            
            // TAMT = amnt*FVIFA
            var TAMT = amnt*FVIFA ;
            
            document.forms[0].TAMT.value = FmtNumStr(TAMT);
}

function FmtCurrency( numval)
{
	var itmp = (Math.round(100*numval))/100;
	
	return itmp;
}

function CleanNumStr(val)
{	
	var tmp = val;
	var tmp2;
	var res = "";
	for (i = 0; i < tmp.length; i++)
	{
		tmp2 = tmp.charAt(i);
		if (" " == tmp2)
			continue;
		if ("." == tmp2)
			return res;
			
		if (!isNaN(tmp2))
		{
			res= res + tmp.charAt(i);
		}
	} 
	
	return res;

}

function CleanFloatStr(val)
{	
	var tmp = val;
	var tmp2;
	var res = "";
	var fp = false;
	for (i = 0; i < tmp.length; i++)
	{
		tmp2 = tmp.charAt(i);
		if (" " == tmp2)
			continue;
		if ("." == tmp2)
		{
			if (fp)
				return res;
			fp = true;
			res= res + tmp.charAt(i);
		}
			
		if (!isNaN(tmp2))
		{
			res= res + tmp.charAt(i);
		}
	} 
	
	return res;

}


function FmtNumStr(val)
{
	var res = parseInt(parseFloat(val)*100)/100;
	var s = new String(res);
	
	// add .00
	var pos = s.indexOf(".");
	if (-1 ==pos)
	{
		pos = s.length;
		s = s + ".00";
	}
	
	while (pos >= (s.length -2))
	{
		s = s + "0";
	}
	
	////
	
	res = "";
	var t = 0;
	var b = false;
	
	for(var i = (s.length-1); i >=0; i--)
	{

		res=s.charAt(i)+res;
	
		if ('.' == s.charAt(i))
		{
			i--;
			break;
		}
			

	}
	
	for(; i >=0; i--)
	{
		if (t && !(t%3))
			res="," + res;
			
		res=s.charAt(i)+res;
		t++;
	}
	return res;

/*

	// get int part
	var ip= parseInt(val);
	//var ip= val.toPrecition(2);
	
	// get remaining part
	var rp = parseFloat(val) - ip;
	rp = FmtCurrency(rp);
	
	// does not work	
	while (rp.length < 4)
	{
		rp = rp + "0";
	}
	var ips1 = new String(rp);

	rp = ips1.charAt(1) + ips1.charAt(2) + ips1.charAt(3);
	alert (rp);
	
	var res = "";
	var ips = new String(ip);
	var t = 0;
	for(var i = (ips.length-1); i >=0; i--)
	{
		if (t && !(t%3))
			res="," + res;
		res=ips.charAt(i)+res;
		t++;
	}
	return res + rp;
*/	
}


function OpenFull(URL) {

	var w,h;

	if (window.screen) {
		var w = window.screen.availWidth;
		var h = window.screen.availHeight;
		}
	else
		{
		var w = 800;
		var h = 600;
	
	}
	
		
	// pop-up preview URL
	FullWindow = window.open(URL, 'FullWindow', 'fullscreen=yes,width=' + w + ',height=' + h + ',scrollbars=auto,resizable=yes');
	FullWindow.focus()

}


function ShowNewMexicoTexas() {

	var el;
	var IsIE;
	
	if ( navigator.appVersion.indexOf('MSIE') > 0 ) { IsIE = true } else { IsIE = false }
	
	//hide map
	el = document.getElementById('trMap');
	el.style.display = 'none';
	// show the New Mexico/Texas rows	
	el = document.getElementById('trNMT_PM1');
	if (IsIE == true) { el.style.display = 'block'; } else { el.style.display = 'table-row' };	
	el = document.getElementById('trNMT_PM2');
	if (IsIE == true) { el.style.display = 'block'; } else { el.style.display = 'table-row' };
	el = document.getElementById('trNMT_PM3');
	if (IsIE == true) { el.style.display = 'block'; } else { el.style.display = 'table-row' };
	el = document.getElementById('trNMT_PM4');
	if (IsIE == true) { el.style.display = 'block'; } else { el.style.display = 'table-row' };
	el = document.getElementById('trNMT_PM5');
	if (IsIE == true) { el.style.display = 'block'; } else { el.style.display = 'table-row' };
	el = document.getElementById('trNMT_PM6');
	if (IsIE == true) { el.style.display = 'block'; } else { el.style.display = 'table-row' };

}

function ShowNonNewMexicoTexas() {

	var el;
	var IsIE;
	
	if ( navigator.appVersion.indexOf('MSIE') > 0 ) { IsIE = true } else { IsIE = false }
	
	//hide map
	el = document.getElementById('trMap');
	el.style.display = 'none';
	// show the New Mexico/Texas rows	
	el = document.getElementById('trNNMT_PM2');
	if (IsIE == true) { el.style.display = 'block'; } else { el.style.display = 'table-row' };
	el = document.getElementById('trNNMT_PM3');
	if (IsIE == true) { el.style.display = 'block'; } else { el.style.display = 'table-row' };	
	el = document.getElementById('trNNMT_PM4');
	if (IsIE == true) { el.style.display = 'block'; } else { el.style.display = 'table-row' };	
	el = document.getElementById('trNNMT_PM5');
	if (IsIE == true) { el.style.display = 'block'; } else { el.style.display = 'table-row' };	
	el = document.getElementById('trNNMT_PM6');
	if (IsIE == true) { el.style.display = 'block'; } else { el.style.display = 'table-row' };		
	el = document.getElementById('trNNMT_PM7');
	if (IsIE == true) { el.style.display = 'block'; } else { el.style.display = 'table-row' };			

}

function ShowMap() {

	var el;
	var IsIE;
	
	if ( navigator.appVersion.indexOf('MSIE') > 0 ) { IsIE = true } else { IsIE = false }	
	
	//hide map
	el = document.getElementById('trMap');
	if (IsIE == true) { el.style.display = 'block'; } else { el.style.display = 'table-row' };
	// hide the New Mexico/Texas rows	
	el = document.getElementById('trNMT_PM1');
	el.style.display = 'none';	
	el = document.getElementById('trNMT_PM2');
	el.style.display = 'none';
	el = document.getElementById('trNMT_PM3');
	el.style.display = 'none';	
	el = document.getElementById('trNMT_PM4');
	el.style.display = 'none';	
	el = document.getElementById('trNMT_PM5');
	el.style.display = 'none';	
	el = document.getElementById('trNMT_PM6');
	el.style.display = 'none';	
	// hide the New Mexico/Texas rows	
	el = document.getElementById('trNNMT_PM2');
	el.style.display = 'none';
	el = document.getElementById('trNNMT_PM3');
	el.style.display = 'none';	
	el = document.getElementById('trNNMT_PM4');
	el.style.display = 'none';	
	el = document.getElementById('trNNMT_PM5');
	el.style.display = 'none';	
	el = document.getElementById('trNNMT_PM6');
	el.style.display = 'none';		
	el = document.getElementById('trNNMT_PM7');
	el.style.display = 'none';						
	
}

function ShowJobInterestForm() {

    var el;
    
    el = FindMyControl('divInterestForm');
 
    PositionLayer(el.id, 200, 200);
    ShowLayer(el.id);

}

function CancelInterestForm() {

   var el;
    
    el = FindMyControl('divInterestForm');
    CancelLayer(el.id);
}

function SubmitInterestForm() {

    var el;
    
    // validate that the notifiy manager option is checked    
    var inputs = document.getElementsByTagName ('input');
    if (inputs) {
    for (var i = 0; i < inputs.length; ++i) {
      if (inputs[i].type == 'radio' && inputs[i].id.indexOf('Notified_No') > -1)
            {
                if (inputs[i].checked == true && location.href.indexOf('AE01A9AE')) { alert('For internal applications, you must notify your manager prior to applying for a position.\n\nPlease either select \"Yes\" on this question or notify your manager and then apply for this job.'); return; }
            } 
      }
    }
   
    el = FindMyControl('txtIF_ApplicantName');
    if ( el.value.length <= 3 ) {
        alert('A valid name is required.\n\nPlease enter a valid applicant name to continue.'); return;
    }
    
    el = FindMyControl('txtIF_CurrentTitle');
    if ( el.value.length <= 3 ) {
        alert('A valid current title is required.\n\nPlease enter a valid current title to continue.'); return;
    }    
    
    el = FindMyControl('txtIF_CurrentManager');
    if ( el != false ) {
        if ( el.value.length <= 3 ) {
            alert('A valid current manager is required.\n\nPlease enter a valid current manager to continue.'); return;
        }    
    }
    
    el = FindMyControl('txtIF_ContactPhone');
    if ( el != false ) {
        if ( el.value.length <= 8 ) {
            alert('A valid contact phone is required.\n\nPlease enter a valid phone number to continue.'); return;
        }    
    }    
    
    el = FindMyControl('txtIF_EmailAddress');
    if ( el != false ) {
        if ( el.value.indexOf('@') == -1 || el.value.indexOf('.') == -1 ) {
            alert('A valid email address is required.\n\nPlease enter a valid phone email address to continue.'); return;
        }    
    }    
    
    el = FindMyControl('fleResume');
    if ( el != false && location.href.indexOf('EF6FB99E') != -1 ) {
        if ( el.value.length <= 4 ) {
            alert('You must select a resume file in order to continue.\n\nPlease use the \"Attache Resume\" box to select a valid resume.'); return;
        }    
    } 
    
    el = FindMyControl('selGender');
    if ( el != false ) {
        if ( el.selectedIndex == 0 ) { alert('Please review the EEO section.  You must provide a response to the \"Gender\" question even if you decline to identify.'); return; }
    }
    
    el = FindMyControl('selEthnicity');
    if ( el != false ) {
        if ( el.selectedIndex == 0 ) { alert('Please review the EEO section.  You must provide a response to the \"Race/Ethnicity\" question even if you decline to identify.'); return; }
    }    
    
    
    el = FindMyControl('hdAction');
    el.value = 'SubmitInterestForm';
    
    el.form.submit();
    
}

function LaunchFenceBuilder() {

    var Link;
    var FBWindow;
    var myDate = new Date();
    
    Link = '../FenceBuilder.aspx';
    // append a DateTime stamp to prevent caching
    DT = 'DATESTAMP' + myDate.getMonth();
    DT = DT + myDate.getDate();
    DT = DT + myDate.getYear();
    DT = DT + myDate.getHours();
    DT = DT + myDate.getMinutes();
    DT = DT + myDate.getSeconds();
    Link = Link + '?DT=' + DT;
    // pop-up chat window
    FBWindow = window.open(Link, 'FB', 'toolbars=0, scrollbars=1, location=0, statusbars=0, menubars=0, resizable=1, width=610, height=535, left=75, top=15');
    FBWindow.focus()

}


var Current = '';

function ShowMapPopUp(id,e) {

    var el;
    
    if (!e) e = window.event;
    
    el = document.getElementById(id);
    if ( el == null ) { return; }
	
	if (Current != '') {
		HideMapPopUp(Current);
	}

	el.style.left = e.clientX + 5 +'px';
	el.style.top = e.clientY + scrollTop() + 5 + 'px';
    el.style.visibility = 'visible';

    Current=id;

}

function HideMapPopUp(id) {
    var el;
           
    el = document.getElementById(id);
    el.style.visibility = 'hidden';
}

function scrollTop()
{
    var y;
    if (self.pageYOffset) // all except Explorer
    {
	    y = self.pageYOffset;
    }
    else if (document.documentElement && document.documentElement.scrollTop)
	    // Explorer 6 Strict
    {

	    y = document.documentElement.scrollTop;
    }
    else if (document.body) // all other Explorers
    {
	    y = document.body.scrollTop;
    }

    return y
}

function ValidateRequestForQuote() {

    var el;
    
    el = FindMyControl('txtName');
    if ( el.value.length <= 1 ) { alert('You must provide your name in order to complete the request for quote form.'); return; }
    el = FindMyControl('txtLocation');
    if ( el.value.length <= 1 ) { alert('You must provide a location in order to complete the request for quote form.'); return; }    
    el = FindMyControl('txtPhone');
    if ( el.value.length <= 7 ) { alert('You must provide a valid phone number in order to complete the request for quote form.'); return; }    
    
    el.form.submit();
}

function PBS_Continue() {
    document.forms[0].submit();
}

function Validate_PBS_Request_Form() {

    var el;
    
    el = FindMyControl('txtPBS_Name');
    if ( el.value.length <= 4 ) { alert('You must provide a valid name in order to complete the request.'); return; }
    el = FindMyControl('txtPBS_Email');
    if ( el.value.length <= 4 ) { alert('You must provide a valid email address in order to complete the request.'); return; }
    el = FindMyControl('txtPBS_Phone_Number');
    if ( el.value.length <= 4 ) { alert('You must provide a valid phone number in order to complete the request.'); return; }
    el = FindMyControl('txtPBS_Recipients_Name');
    if ( el.value.length <= 4 ) { alert('You must provide a valid recipients email address in order to complete the request.'); return; }
    el = FindMyControl('txtPBS_Recipients_Email');
    if ( el.value.length <= 4 ) { alert('You must provide a valid recipients email address in order to complete the request.'); return; }
    
    el.form.submit();
    
}

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];
}


