<!--

function Layout(){

this.avail = screen.availWidth;
this.newScreenSize = 770;
this.scrollbarOffset = 22;

    Layout.prototype.changeDisplay = function(val){
                if(val){
                        if(val == -1){
                            this.newScreenSize = this.avail - this.scrollbarOffset;
                        }
                        else if((val + this.scrollbarOffset) <=  this.avail){
                            this.newScreenSize = val;
                        }
                }
                else{
                    this.setDefault();  
                }
                this.setDisplay();
                this.setConditionals();
     }
     Layout.prototype.setDisplay = function(){
                var el = document.getElementById('wrapper');
                el.style.width = (this.newScreenSize)+'px';
                el.style.marginLeft = (-1 * ((this.newScreenSize)/2)) +'px';
                var img = new Image();
                img.src='/spc/display.aspx?scr=' + this.newScreenSize;
     }
     Layout.prototype.setDefault = function(){
                 if(this.avail > 1100 + this.scrollbarOffset){this.newScreenSize = 1100;}
                        else if(this.avail > 1000 + this.scrollbarOffset){this.newScreenSize = 1000;}
                        else {this.newScreenSize = 770;}
     }
     Layout.prototype.setConditionals = function(){
                var el = document.getElementById('splnk');
                if(this.newScreenSize <= 770 && el){
                el.innerHTML = 'Spares';
                el.style.width = '101px';
                }
                else if(this.newScreenSize > 770 && el){
                el.innerHTML = 'Spares & Service';
                el.style.width = '110px';
                }
     }
}
var display = new Layout();

function moveLeftNav(){
    var alpha = document.getElementById('navAlpha2');
    var tg = document.getElementById('navAlpha');
    tg.appendChild(alpha);
    }
    function moveRightNav(){
    var alpha = document.getElementById('navBeta2');
    var tg = document.getElementById('navBeta');
    tg.appendChild(alpha);
    }
    
    function IE6AdjustInnCnt(){
    document.getElementById('inncnt').style.marginTop = -10 + 'px';
    }
function emailPage(host){

    var linkUrl = window.location.href
    while(linkUrl.indexOf("&") > -1){
    linkUrl = linkUrl.replace('&',';')
    }
    window.location = 'http://' + host  + '/email-page.aspx?lurl=' + linkUrl + '&amp;t=' + window.document.title
} 
function changePage(url){
window.location = url;
window.open(url,'Product Detail','',true);
}
function AddBookmark() {
// IE Favorite	Only - others unreliable addPanel etc
window.external.AddFavorite(window.location,document.title);}

function mymenu(myDefault){
this.orig = myDefault;
}
function submnu(index){
}
function menuon(){
//alert(document.getElementById('sdlnkscnt').innerHTML)
//document.getElementById('sdlnkscnt').innerHTML = "<A>New ATV's</A><A>Pre-owned ATV's</A><A>Click for More Options</A>"
}
function menuoff(){
window.setTimeout(toDefault,2000)
}
function toDefault(){
}
function imgSwap(img){
var mn = document.getElementById('mpic');
mn.src = img.src.replace('w=90&h=60','w=360&h=240');
}
function ShowAdvSearch(StandardPanelId, AdvancedPanelId,gardenSize){
document.getElementById(StandardPanelId).style.display = "none";
document.getElementById(AdvancedPanelId).style.display = "inline";
if(document.getElementById('advreqPnl')){
document.getElementById('advreqPnl').style.display = "none";
}//end if
if(gardenSize){
//Requires element Select List
var itm = document.getElementById('SrchCategory');
if(gardenSize==1){document.getElementById('sizeSelect').value =  1;}//end if
if(gardenSize==2){document.getElementById('sizeSelect').value = 2;}//end if
if(gardenSize==3){document.getElementById('sizeSelect').value = 3;}//end if
}//end if
}//end function
function HideAdvSearch(StandardPanelId, AdvancedPanelId){
document.getElementById(StandardPanelId).style.display = "inline";
document.getElementById(AdvancedPanelId).style.display = "none";
if (document.getElementById('advreqPnl')){
document.getElementById('advreqPnl').style.display = "inline";}//emd if
}//end funct

function loaded(){

if (document.getElementById){
var trg = document.getElementById('trg')
var standardPanel = document.getElementById('standardPanel')
var advancedPanel = document.getElementById('optionsPanel')
//Expects up to three constant form panel ID's - "standardPanel", "optionsPanel", optional -> "advReqPnl"
if (trg){
if (trg.value=='1' && standardPanel && advancedPanel){
ShowAdvSearch('standardPanel','optionsPanel');
}//end if
}//end if
}//End if
var frm = document.getElementById('pnltrg');
if(frm){partsPanelView(frm.value)};
}//end funct
//For testing Only
function changeStyle(Target){
	if( document.createElement && document.childNodes ) {
		var scriptElem = document.createElement('LINK');
		scriptElem.setAttribute('href',Target);
		scriptElem.setAttribute('type','text/css');
		scriptElem.setAttribute('rel','stylesheet');
		document.getElementsByTagName('head')[0].appendChild(scriptElem);
	}//End IF
}//End Function
function loadStyle(PageType,UserDef){
    var setVal = UserDef
    if(!setVal){var setVal = screen.availWidth}
	if( document.createElement && document.childNodes ) {
		var scriptElem = document.createElement('LINK');
		scriptElem.setAttribute('href','/spc/display.aspx?ptype=' + PageType + '&scr=' + setVal);
		scriptElem.setAttribute('type','text/css');
		scriptElem.setAttribute('rel','stylesheet');
		document.getElementsByTagName('head')[0].appendChild(scriptElem);
	}//End IF
}//End Function
function changePic(imgid,newSrc){
document.getElementById(imgid).src = newSrc
}
function clearValue(itm){
itm.value= '';
}
function partsPanelView(keyValue){
if(keyValue=='0'){
document.getElementById('ppnl0').style.display='inline';
document.getElementById('ppnl1').style.display='none';
document.getElementById('ppnl2').style.display='none';
}
if(keyValue=='1'){
document.getElementById('ppnl0').style.display='none';
document.getElementById('ppnl1').style.display='inline';
document.getElementById('ppnl2').style.display='none';
}
if(keyValue=='2'){
document.getElementById('ppnl0').style.display='none';
document.getElementById('ppnl1').style.display='none';
document.getElementById('ppnl2').style.display='inline';
}
}
function changeDept(newDept){
alert(newDept)
}
function showTerms(){
openPayWin("/spc/terms.aspx?js=1", 700,window.screen.availHeight - 150, 10,10);
}
function closeWin(itm){window.opener= "";window.close();}
function openPayWin(itm, width, height, positionLeft,PositionRight){
//win = window.open("/hlp.aspx?itm=" + itm, "HelpWindow", "toolbar=false,menubar=0,title='false',width=520,height=320,scrollbars=auto");
win = window.open(itm, "HelpWindow", "toolbar=1,menubar=1,resize=1,statusbar=1,title='true',width=" + width + ",height=" +  height + ",scrollbars=1");
//win.moveTo(180,100);
};
/**
Original Stuff
 var el = document.getElementById('wrapper');
    if(sz){
        if(sz==-1){
        el.style.width = (screen.availWidth - 22)+'px';
        el.style.marginLeft = (-1 * ((screen.availWidth -22)/2)) +'px';
        return false;
        }
        if(window.screen.availWidth >= sz + 18){
        el.style.width = sz  +'px';
        el.style.marginLeft = (-1 * (sz/2)) +'px';
        if(sz < 800){var sps = document.getElementById('spLnk');sps.innerHTML ='Spares';sps.style.width='101px';}
       }// end if
        return false;
        }// end if  
    if(window.screen.availWidth < 1000){
        var sW = 770;
        el.style.width = sW +'px';
        el.style.marginLeft = (-1 * (sW/2)) +'px';
       }// end if
       else{
            el.style.width = (screen.availWidth - 22)+'px';
            el.style.marginLeft = (-1 * ((screen.availWidth -22)/2)) +'px';}// end if
    }// end function

**/


//-->