<!--

/*        sIFR (Scalable Inman Flash Replacement) Version 2.0 RC1
        Copyright 2004 Mike Davidson, Shaun Inman, Tomas Jogin and Mark Wubben

*/

var hasFlash = function(){
        var nRequiredVersion = 6;

        if(navigator.appVersion.indexOf("MSIE") != -1 && navigator.appVersion.indexOf("Windows") > -1){
                document.write('<script language="VBScript"\> \n');
                document.write('on error resume next \n');
                document.write('hasFlash = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & ' + nRequiredVersion + '))) \n');
                document.write('<'+'/script\> \n');
                /*        If executed, the VBScript above checks for Flash and sets the hasFlash variable.
                        If VBScript is not supported it's value will still be undefined, so we'll run it though another test
                        This will make sure even Opera identified as IE will be tested */
                if(window.hasFlash != null){
                        return window.hasFlash;
                };
        };

        if(navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"] && navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin){
                var flashDescription = (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]).description;
                var flashVersion = parseInt(flashDescription.charAt(flashDescription.indexOf(".") - 1));
                return flashVersion >= nRequiredVersion;
        };

        return false;
}();

String.prototype.normalize = function(){
        return this.replace(/\s+/g, " ");
};

/* IE 5.0 does not support the push method, so here goes */
if(Array.prototype.push == null){
        Array.prototype.push = function(item){
                this[this.length] = item;
                return this.length;
        };
};

/*        Implement function.apply for browsers which don't support it natively
        Courtesy of Aaron Boodman - http://youngpup.net */
if (!Function.prototype.apply){
        Function.prototype.apply = function(oScope, args) {
                var sarg = [];
                var rtrn, call;

                if (!oScope) oScope = window;
                if (!args) args = [];

                for (var i = 0; i < args.length; i++) {
                        sarg[i] = "args["+i+"]";
                };

                call = "oScope.__applyTemp__(" + sarg.join(",") + ");";

                oScope.__applyTemp__ = this;
                rtrn = eval(call);
                oScope.__applyTemp__ = null;
                return rtrn;
        };
};

/*        The following code parses CSS selectors.
        This script however is not the right place to explain it,
        please visit the documentation for more information. */
var parseSelector = function(){
        var reParseSelector = /^([^#\.>\`]*)(#|\.|\>|\`)(.+)$/;
        function parseSelector(sSelector, oParentNode, sMode){
                sSelector = sSelector.replace(" ", "`");
                var selector = sSelector.match(reParseSelector);
                var node, listNodes, listSubNodes, subselector;
                var listReturn = [];

                if(selector == null){ selector = [sSelector, sSelector]        };
                if(selector[1] == ""){ selector[1] = "*" };
                if(sMode == null){ sMode = "`" };

                switch(selector[2]){
                        case "#":
                                subselector = selector[3].match(reParseSelector);
                                if(subselector == null){ subselector = [null, selector[3]] };
                                node =         document.getElementById(subselector[1]);
                                if(node == null || (selector[1] != "*" && node.nodeName.toLowerCase() != selector[1].toLowerCase())){
                                        return listReturn;
                                };
                                if(subselector.length == 2){
                                        listReturn.push(node);
                                        return listReturn;
                                };
                                return parseSelector(subselector[3], node, "#");
                        case ".":
                                if(sMode == "`"){
                                        listNodes = getElementsByTagName(oParentNode, selector[1]);
                                } else {
                                        listNodes = oParentNode.childNodes;
                                };

                                for(var i = 0; i < listNodes.length; i++){
                                        node = listNodes[i];
                                        if(node.nodeType != 1){
                                                continue;
                                        };

                                        subselector = selector[3].match(reParseSelector);
                                        if(subselector != null){
                                                if(node.className.match("\\b" + subselector[1] + "\\b") == null){
                                                        continue;
                                                };
                                                listSubNodes = parseSelector(subselector[3], node, subselector[2]);
                                                listReturn = listReturn.concat(listSubNodes);
                                        } else if(node.className.match("\\b" + selector[3] + "\\b") != null){
                                                listReturn.push(node);
                                        };
                                };
                                return listReturn;
                        case ">":
                                if(sMode == "`"){
                                        listNodes = getElementsByTagName(oParentNode, selector[1]);
                                } else {
                                        listNodes = oParentNode.childNodes;
                                };
                                for(var i = 0; i < listNodes.length; i++){
                                        node = listNodes[i];
                                        if(node.nodeType != 1){
                                                continue;
                                        };
                                        if(node.nodeName.toLowerCase() != selector[1].toLowerCase()){
                                                continue;
                                        };
                                        listSubNodes = parseSelector(selector[3], node, ">");
                                        listReturn = listReturn.concat(listSubNodes);
                                };
                                return listReturn;
                        case "`":
                                listNodes = getElementsByTagName(oParentNode, selector[1]);
                                for(var i = 0; i < listNodes.length; i++){
                                        node = listNodes[i];
                                        listSubNodes = parseSelector(selector[3], node, "`");
                                        listReturn = listReturn.concat(listSubNodes);
                                };
                                return listReturn;
                        default:
                                listNodes = getElementsByTagName(oParentNode, selector[0]);
                                for(var i = 0; i < listNodes.length; i++){
                                        listReturn.push(listNodes[i]);
                                };
                                return listReturn;
                };
        };

        function getElementsByTagName(oParentNode, sTagName){
                /*        IE5.x does not support document.getElementsByTagName("*")
                        therefore we're resorting to element.all */
                if(sTagName == "*" && oParentNode.all != null){
                        return oParentNode.all;
                };
                return oParentNode.getElementsByTagName(sTagName);
        };

        return parseSelector;
}();

/*        Executes an anonymous function which returns the function sIFR (defined inside the function).
        You can replace elements using sIFR.replaceElement()
        All other variables and methods you see are private. If you want to understand how this works you should
        learn more about the variable-scope in JavaScript. */
var sIFR = function(){
        if(window.hasFlash == false || !document.createElement || !document.getElementById){ return function(){return false} };

        /* Providing a hook for you to hide certain elements if Flash has been detected */
        if(document.documentElement){
                document.documentElement.className = document.documentElement.className.normalize() + (document.documentElement.className == "" ? "" : " ") + "sIFR-hasFlash";
        };

        /* Opera and Mozilla require a namespace when creating elements in an XML page */
        var sNameSpaceURI = "http://www.w3.org/1999/xhtml";
        var UA = function(){
                var sUA = navigator.userAgent.toLowerCase();
                var oReturn =  {
                        bIsKHTML: sUA.indexOf('safari') > -1 || sUA.indexOf('konqueror') > -1 || sUA.indexOf('omniweb') > -1,
                        bIsOpera : sUA.indexOf('opera') > -1,
                        bIsGecko : navigator.product != null && navigator.product.toLowerCase() == 'gecko',
                        bIsXML : document.contentType != null && document.contentType.indexOf('xml') > -1
                };
                oReturn.bIsIE = sUA.indexOf('msie') > -1 && ! oReturn.bIsOpera && !oReturn.bIsKHTML && !oReturn.bIsGecko;
                return oReturn;
        }();

        var bIsInitialized = false;
        var stackReplaceElementArguments = [];

        function fetchContent(oNode, oNewNode, sCase){
                var sContent = "";
                var oSearch = oNode.firstChild;
                var oRemove, oRemovedNode, oTarget;

                while(oSearch){
                        if(oSearch.nodeType == 3){
                                switch(sCase){
                                        case "lower":
                                                sContent += oSearch.nodeValue.toLowerCase();
                                                break;
                                        case "upper":
                                                sContent += oSearch.nodeValue.toUpperCase();
                                                break;
                                        default:
                                                sContent += oSearch.nodeValue;
                                };
                        } else if(oSearch.nodeType == 1){
                                if(oSearch.nodeName.toLowerCase() == "a"){
                                        if(oSearch.getAttribute("target")){
                                                oTarget = oSearch.getAttribute("target");
                                        } else {
                                                oTarget = "";
                                        };
                                        sContent += '<a href="' + oSearch.getAttribute("href") + '" target="' + oTarget + '">';
                                };
                                if(oSearch.hasChildNodes){
                                        sContent += fetchContent(oSearch, null, sCase);
                                };
                                if(oSearch.nodeName.toLowerCase() == "a"){
                                        sContent += "</a>";
                                };
                        };
                        oRemove = oSearch;
                        oSearch = oSearch.nextSibling;
                        if(oNewNode != null){
                                oRemovedNode = oRemove.parentNode.removeChild(oRemove);
                                oNewNode.appendChild(oRemovedNode);
                        };
                };
                return sContent;
        };

        function createElement(sTagName){
                if(document.createElementNS){
                        return document.createElementNS(sNameSpaceURI, sTagName);
                } else {
                        return document.createElement(sTagName);
                };
        };

        function createObjectParameter(nodeObject, sName, sValue){
                var node = createElement("param");
                node.setAttribute("name", sName);
                node.setAttribute("value", sValue);
                nodeObject.appendChild(node);
        };

        function replaceElement(sSelector, sFlashSrc, sColor, sLinkColor, sHoverColor, sBgColor, nPaddingTop, nPaddingRight, nPaddingBottom, nPaddingLeft, sFlashVars, sCase){
                if(!mayReplace()){
                        return stackReplaceElementArguments.push(arguments);
                };

                if(sFlashVars != null){
                        sFlashVars = "&" + sFlashVars.normalize();
                } else {
                        sFlashVars = "";
                };

                var sWmode = (sBgColor == "transparent") ? "transparent" : "opaque";
                var node, sWidth, sHeight, sMargin, sPadding, sText, sVars, nodeAlternate, nodeFlash;
                var listNodes = parseSelector(sSelector, document);
                if(listNodes.length == 0){ return false };

                for(var i = 0; i < listNodes.length; i++){
                        node = listNodes[i];

                        /* Prevents elements from being replaced multiple times. */
                        if(node.className.match(/\bsIFR\-replaced\b/) != null){ continue; };

                        sWidth = node.offsetWidth - nPaddingLeft - nPaddingRight;
                        sHeight = node.offsetHeight - nPaddingTop - nPaddingBottom;

                        nodeAlternate = createElement("span");
                        nodeAlternate.className = "sIFR-alternate";

                        sText = fetchContent(node, nodeAlternate, sCase);
                        sText = sText.replace(/%\d{0}/g, "%25");
                        sText = sText.replace(/\+/g, "%2B");
                        sText = sText.replace(/&/g, "%26");
                        sText = sText.replace(/\"/g, "%22");
                        sText = sText.normalize();

                        sVars = "txt=" + sText + sFlashVars + "&w=" + sWidth + "&h=" + sHeight;
                        if (sColor != null){sVars += "&textcolor=" + sColor};
                        if (sLinkColor != null){sVars += "&linkcolor=" + sLinkColor};
                        if (sHoverColor != null){sVars += "&hovercolor=" + sHoverColor};

                        node.className = node.className.normalize() + (node.className == ""  ? "" : " ") + "sIFR-replaced";

                        /*        Opera only supports the object element, other browsers are given the embed element,
                                for backwards compatibility reasons between different browser versions. */
                        if(UA.bIsOpera){
                                nodeFlash = createElement("object");
                                nodeFlash.setAttribute("type", "application/x-shockwave-flash");
                                nodeFlash.setAttribute("data", sFlashSrc);
                                createObjectParameter(nodeFlash, "quality", "high");
                                createObjectParameter(nodeFlash, "wmode", sWmode);
                                createObjectParameter(nodeFlash, "bgcolor", sBgColor);
                                createObjectParameter(nodeFlash, "flashvars", sVars);
                        } else {
                                nodeFlash = createElement("embed");
                                nodeFlash.setAttribute("src", sFlashSrc);
                                nodeFlash.setAttribute("flashvars", sVars);
                                nodeFlash.setAttribute("type", "application/x-shockwave-flash");
                                nodeFlash.setAttribute("pluginspage", "http://www.macromedia.com/go/getflashplayer");
                                nodeFlash.setAttribute("wmode", sWmode);
                                nodeFlash.setAttribute("bgcolor", sBgColor);
                        };
                        nodeFlash.className = "sIFR-flash";
                        nodeFlash.setAttribute("width", sWidth);
                        nodeFlash.setAttribute("height", sHeight);
                        nodeFlash.style.width = sWidth + "px";
                        nodeFlash.style.height = sHeight + "px";
                        node.appendChild(nodeFlash);

                        node.appendChild(nodeAlternate);

                        /*        Workaround to force KHTML-browsers to repaint the document.
                                Additionally, IE for both Mac and PC need this.
                                See: http://neo.dzygn.com/archive/2004/09/forcing-safari-to-repaint */

                        if(UA.bIsKHTML || UA.bIsIE){
                                node.innerHTML += "";
                        };
                };
        };

        function mayReplace(e){
                if(((UA.bIsXML && UA.bIsGecko || UA.bIsKHTML) && e == null && bIsInitialized == false) || document.getElementsByTagName("body").length == 0){
                        return false;
                };
                return true;
        };

        function sIFR(e){
                if((!sIFR.bAutoInit && (window.event || e) != null) || !mayReplace(e)){
                        return;
                };
                bIsInitialized = true;

                for(var i = 0; i < stackReplaceElementArguments.length; i++){
                        replaceElement.apply(null, stackReplaceElementArguments[i]);
                };
                stackReplaceElementArguments = [];
        };

        sIFR.replaceElement = replaceElement;
        sIFR.UA = UA;
        sIFR.bAutoInit = true;

        if(window.attachEvent){
                window.attachEvent("onload", sIFR);
        } else if(document.addEventListener || window.addEventListener){
                if(document.addEventListener){
                        document.addEventListener("load", sIFR, false);
                };
                if(window.addEventListener){
                        window.addEventListener("load", sIFR, false);
                };
        } else {
                if(typeof window.onload == "function"){
                        var fOld = window.onload;
                        window.onload = function(){ fOld(); sIFR(); };
                } else {
                        window.onload = sIFR;
                };
        };

        return sIFR;
}();

// ||||||||||||||||||||||||||||||||||||||||||||||||||
// tabs properties

var preloaded = 0;
var img_l, img_c, img_r;
var lnkColor="";

function tabs_getObjectByID(id) {
  if (document.layers)          return document.layers[id];
  if (!document.getElementById) return document.all[id];
  return document.getElementById(id);
}

function tabs_setPreloaded() {
  preloaded = true;
}

function tabs_preload() {
  img_l = new Image();
  img_c = new Image();
  img_r = new Image();
  img_l.src = "images/btn_left_o.gif";
  img_c.src = "images/btn_back_o.gif";
  img_r.src = "images/btn_right_o.gif";
}

function tabs_button(obj, state) {
  if (!preloaded) return;
  var btn_l = tabs_getObjectByID(obj.id+'_l');
  var btn_c = tabs_getObjectByID(obj.id+'_c');
  var btn_r = tabs_getObjectByID(obj.id+'_r');
  if (state)
  {
    btn_l.src = img_l.src;
    btn_c.style.backgroundImage = "url(images/btn_back_o.gif)";
    btn_r.src = img_r.src;
    lnkColor = obj.style.color;
    obj.style.color = "#FFFFFF";
  }
  else
  {
    btn_l.src = "images/btn_left.gif";
    btn_c.style.backgroundImage = "url(images/btn_back.gif)";
    btn_r.src = "images/btn_right.gif";
    obj.style.color = lnkColor;
  }
}

tabs_preload();
// onload = tabs_setPreloaded;


/************* Form Validation ***************/

function validatefield(thisfield,imgname){
  if (thisfield.value == "") {
  imgname.src="images/stop.gif";
  }
  else
  {
  imgname.src="images/blank.gif";
  }
}

function validate_email(theControl)
{

    if ( theControl.value == "" || theControl.value.length <= 0 )
    {

   alert("I'm sorry. This email address must be filled in correct to send the form to our server. Please"
   +" check the prefix and '@' sign.");
   theControl.focus()
        return false;
    }

    var reEmail = /^.+\@.+\..+$/
    var holderValue;
    var thisValue = theControl.value;

    // Check for e-mail addresses from ISPs and other sources that have been consistently
    // entered incorrectly.  If detected, correct the situation.
    if
        (
            (thisValue.substring(thisValue.length - 4, thisValue.length).toLowerCase()) == '@aol' ||
            (thisValue.substring(thisValue.length - 4, thisValue.length).toLowerCase()) == '@msn' ||
            (thisValue.substring(thisValue.length - 6, thisValue.length).toLowerCase()) == '@yahoo' ||
            (thisValue.substring(thisValue.length - 6, thisValue.length).toLowerCase()) == '@lycos' ||
            (thisValue.substring(thisValue.length - 7, thisValue.length).toLowerCase()) == '@excite' ||
            (thisValue.substring(thisValue.length - 10, thisValue.length).toLowerCase()) == '@altavista' ||
            (thisValue.substring(thisValue.length - 11, thisValue.length).toLowerCase()) == '@compuserve' ||
            (thisValue.substring(thisValue.length - 8, thisValue.length).toLowerCase()) == '@prodigy' ||
            (thisValue.substring(thisValue.length - 8, thisValue.length).toLowerCase()) == '@hotmail' ||
            (thisValue.substring(thisValue.length - 9, thisValue.length).toLowerCase()) == '@netscape'
        )
        {
            holderValue = thisValue.concat('.com');
            thisValue = holderValue;
            theControl.value = thisValue;
        }
    if
        (
            (thisValue.substring(thisValue.length - 5, thisValue.length).toLowerCase()) == '@home'
        )
        {
            holderValue = thisValue.concat('.net');
            thisValue = holderValue;
            theControl.value = thisValue;
        }

    // Now check the actual value of the e-mail address for validity.
    var flagFirstCheck = (theControl.value.length < 6) ||
        (thisValue.indexOf('@') == -1) ||
        (thisValue.indexOf('.') == -1) ||
        (thisValue.indexOf('@',(thisValue.indexOf('@')+1)) != -1) ||
        ((thisValue.indexOf('.')+1) == thisValue.length) ||
        ((thisValue.indexOf('@')+1) == thisValue.length)
    var flagSecondCheck = reEmail.test(thisValue)
    if ( flagFirstCheck || !flagSecondCheck)
    {

   alert("I'm sorry. This email address seems to be incorrect. Please"
   +" check the prefix and '@' sign.");
   theControl.focus()

        return false;
    }
    else {

        return true;
    }
}

function FEmptyControl(control, prompt) {
  if (control.value=="") {
    alert("The " + prompt +" field is a required field, and it must be filled in before your form can be sent to our server.")
    control.focus()
    return false }
  return true }

function check_search_form(form) {
if (!FEmptyControl(form.keywords,'Enter some keywords for search please??')) return false
   return true }

function check_login_form(form) {
if (!FEmptyControl(form.dealer_id,'Enter your 5 digit Dealer ID please??')) return false
if (!FEmptyControl(form.password,'Enter your Dealer Password please??')) return false
   return true }

function FSubmitValidation(form) {
if (!validate_email(form.email)) return false
if (!FEmptyControl(form.name,'Name')) return false
if (!FEmptyControl(form.address,'Address')) return false
if (!FEmptyControl(form.city,'City')) return false
if (!FEmptyControl(form.state,'State')) return false
if (!FEmptyControl(form.zip,'Zip')) return false
   return true }

/************* End Form Validation ***************/

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_findObj(n, d) { //v4.01
  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 && d.getElementById) x=d.getElementById(n); return x;
}

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];}
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  return window.open(theURL,winName,features);
}

function MM_callJS(jsStr) { //v2.0
  return eval(jsStr)
}

function renderStateList() {
        var values = new Array( "AK", "AL", "AR", "AZ", "CA", "CO", "CT", "DC", "DE", "FL", "GA", "HI", "IA", "ID", "IL", "IN", "KS", "KY", "LA", "MA", "MD", "ME", "MI", "MN", "MO", "MS", "MT", "NC", "ND", "NE", "NH", "NJ", "NM", "NV", "NY", "OH", "OK", "OR", "PA", "RI", "SC", "SD", "TN", "TX", "UT", "VA", "VT", "WA", "WI", "WV", "WY" ) ;
        var captions = new Array( "Alaska", "Alabama", "Arkansas", "Arizona", "California", "Colorado", "Connecticut", "District of Columbia", "Delaware", "Florida", "Georgia", "Hawaii", "Iowa", "Idaho", "Illinois", "Indiana", "Kansas", "Kentucky", "Louisiana", "Massachusetts", "Maryland", "Maine", "Michigan", "Minnesota", "Missouri", "Mississippi", "Montana", "North Carolina", "North Dakota", "Nebraska", "New Hampshire", "New Jersey", "New Mexico", "Nevada", "New York", "Ohio", "Oklahoma", "Oregon", "Pennsylvania", "Rhode Island", "South Carolina", "South Dakota", "Tennessee", "Texas", "Utah", "Virginia", "Vermont", "Washington", "Wisconsin", "West Virginia", "Wyoming" ) ;
        var buffer = "" ;
        for ( var i = 0 ; i < values.length ; i++ ) {
                buffer += "<option value=\"" + values[ i ] + "\">" + captions[ i ] + "</option>" ;
        }
        return buffer ;
}

function renderFlashTag( Movie, Width, Height, Params ) {
        var buffer = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="' + Width + '" height="' + Height + '">' ;
        buffer += '<param name="movie" value="' + Movie + '">' ;
        var pairs = Params.split( ';' ) ;
        for ( var i = 0 ; i < pairs.length ; i++ ) {
                var name = pairs[ i ].split( '=' )[ 0 ] ;
                var value = pairs[ i ].split( '=' )[ 1 ] ;
                buffer += '<param name="' + name + '" value="' + value + '">' ;
        }
        buffer += '<embed src="' + Movie + '" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="' + Width + '" height="' + Height + '" ' ;
        for ( var i = 0 ; i < pairs.length ; i++ ) {
                var name = pairs[ i ].split( '=' )[ 0 ] ;
                var value = pairs[ i ].split( '=' )[ 1 ] ;
                buffer += name + '="' + value + '" ' ;
        }
        buffer += '></embed></object>' ;
        return buffer ;
}


function privacy() {
        var newWindow = MM_openBrWindow( 'privacy.php', '_privacy', 'width=650,height=450,toolbar=0,location=0,directories=0,status=0,menuBar=0,scrollBars=1,resizable=0' );
        newWindow.focus();
}

function copyright() {
        var newWindow = MM_openBrWindow( 'copyright.php', '_copyright', 'width=650,height=450,toolbar=0,location=0,directories=0,status=0,menuBar=0,scrollBars=1,resizable=0' );
        newWindow.focus();
}

function dealers() {
        var newWindow = MM_openBrWindow( 'dealers.php', '_dealers', 'width=650,height=450,toolbar=0,location=0,directories=0,status=0,menuBar=0,scrollBars=1,resizable=0' );
        newWindow.focus();
}

function contactus() {
        var newWindow = MM_openBrWindow( '/ContactUs/', '_contactus', 'width=613,height=400,toolbar=0,location=0,directories=0,status=0,menuBar=0,scrollBars=1,resizable=0' );
        newWindow.focus();
}

function bigpicture( model ) {
        var newWindow = MM_openBrWindow( 'imgpopup.php?model='+model, '_bigpicture', 'width=550,height=580,toolbar=0,location=0,directories=0,status=0,menuBar=0,resizable=0,left=100,top=10,screenX=100,screenY=10,scrollbars=no, resize=no');
        newWindow.focus();
}

function showDiv(divID) {
    //get a reference as above ...
    myReference = getRefToDiv(divID);
    if( !myReference ) {
        window.alert('Nothing works in this browser');
        return false; //don't go any further
        //return anything would work,
        //but I am using false to show failure
    }
    //now we have a reference to it
    if( myReference.style ) { //DOM & proprietary DOM
        myReference.style.visibility = 'visible';
    } else {
        if( myReference.visibility ) { //Netscape
            myReference.visibility = 'show';
        } else {
            window.alert('Nothing works in this browser');
            return false; //don't go any further
        }
    }
    return true;
}


function getRefToDiv(divID,oDoc) {
    if( !oDoc ) { oDoc = document; }
    if( document.layers ) {
        if( oDoc.layers[divID] ) { return oDoc.layers[divID]; } else {
            //repeatedly run through all child layers
            for( var x = 0, y; !y && x < oDoc.layers.length; x++ ) {
                //on success, return that layer, else return nothing
                y = getRefToDiv(divID,oDoc.layers[x].document); }
            return y; } }
    if( document.getElementById ) {
        return document.getElementById(divID); }
    if( document.all ) {
        return document.all[divID]; }
    return false;
}

var magicNumber = 0;
function positionElement(divID, pos) {

  if (document.all) {

     availW = document.body.clientWidth;
     availH = document.body.clientHeight;

  } else {

    availW = innerWidth;
    availH = innerHeight;
  }

  magicNumber = (availW / 2) + pos;
  getRefToDiv(divID).style.left = magicNumber;
  getRefToDiv(divID).style.visibility = 'visible';

}


var expDays = 1000;
var cookie_exp = new Date();
cookie_exp.setTime(cookie_exp.getTime() + (expDays*50*60*60*1000));

/**
 * Sets a Cookie with the given name and value.
 *
 * name       Name of the cookie
 * value      Value of the cookie
 * [expires]  Expiration date of the cookie (default: end of current session)
 * [path]     Path where the cookie is valid (default: path of calling document)
 * [domain]   Domain where the cookie is valid
 *              (default: domain of calling document)
 * [secure]   Boolean value indicating if the cookie transmission requires a
 *              secure transmission
 */
function setCookie(name, value, expires, path, domain, secure)
{
    document.cookie= name + "=" + escape(value) +
        ((expires) ? "; expires=" + expires.toGMTString() : "") +
        ((path) ? "; path=" + path : "") +
        ((domain) ? "; domain=" + domain : "") +
        ((secure) ? "; secure" : "");
}

function storeCookie(control, ok) {

if (ok) {
   setCookie(control.name,control.value, cookie_exp, "/");
   }

}


/**
 * Gets the value of the specified cookie.
 *
 * name  Name of the desired cookie.
 *
 * Returns a string containing value of specified cookie,
 *   or null if cookie does not exist.
 */
function getCookie(name)
{
    var dc = document.cookie;
    var prefix = name + "=";
    var begin = dc.indexOf("; " + prefix);
    if (begin == -1)
    {
        begin = dc.indexOf(prefix);
        if (begin != 0) return null;
    }
    else
    {
        begin += 2;
    }
    var end = document.cookie.indexOf(";", begin);
    if (end == -1)
    {
        end = dc.length;
    }
    return unescape(dc.substring(begin + prefix.length, end));
}

/**
 * Deletes the specified cookie.
 *
 * name      name of the cookie
 * [path]    path of the cookie (must be same as path used to create cookie)
 * [domain]  domain of the cookie (must be same as domain used to create cookie)
 */
function deleteCookie(name, path, domain)
{
    if (getCookie(name))
    {
        document.cookie = name + "=" +
            ((path) ? "; path=" + path : "") +
            ((domain) ? "; domain=" + domain : "") +
            "; expires=Thu, 01-Jan-70 00:00:01 GMT";
    }
}

//-->