
sfHover = function() {
var sfEls = document.getElementById("nav").getElementsByTagName("LI");
for (var i=0; i<sfEls.length; i++) {
sfEls[i].onmouseover=function() {
this.className+=" sfhover";
}
sfEls[i].onmouseout=function() {
this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
}
}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);



/* window popups */function openWin( html, name ) {       var n=open( html, name, 'directories=yes,location=yes,menubar=yes,scrollbars=yes,status=yes,toolbar=yes,resizable=yes');              n.focus();}function openWin2( html, name, wval, hval ) {        var x=open( html, name, 'width='+wval+',height='+hval+',directories=no,location=no,menubar=no,scrollbars=no,status=no,toolbar=no,resizable=no');      x.moveTo(((screen.width/2)-(wval/2)),((screen.height/2)-(hval/2)));   x.focus();}function openWin3( html, name ) {    var f=open( html, name, 'width='+screen.width+',height='+screen.height+',directories=no,location=no,menubar=no,scrollbars=yes,status=yes,toolbar=no,resizable=no');   f.focus();}function chkform(){          var lurl = document.addurl.lurl.value;                var ltitle = document.addurl.ltitle.value;            var lemail = document.addurl.lemail.value;            var relink = document.addurl.relink.value;            if(lurl=="" || ltitle=="" || lemail=="" || relink==""){                       alert('Please complete all Fields.')                  return false;         }             else{                 return true;          }     }function setwin_pos(w,h) {               window.moveTo((screen.width-w )/2,(screen.height-h)/2);       }function to_confirm(mess){ // ask to confirm before do somethings.     a = confirm(mess)     if (a==true){         return true   }     else          return false;}function godest(dest){ // with replace      window.location.replace(dest)}function OpenCatalogue(){     if ((document.form1.acode.value=="price2003") || (document.form1.acode.value.charAt(4)=="5"))
        {
                //window.open('../catalogue_frm.asp','',width='770',height='500',resizable='0',scrollbars='0');
                return true;
        }
        else
        {alert('Wrong Authorization Code');
        return false;
        }
}


function chkform(){

                var mess = document.sendmail.message.value;
                var name = document.sendmail.name.value;
                var sender = document.sendmail.email.value;
                if(mess=="" || name=="" || sender==""){
                        alert('Please complete form.')
                        return false;
                }
                else{
                        return true;
                }
        }

function chkformAddlink(){
                var lurl = document.addurl.url.value;
                var ltitle = document.addurl.title.value;
                var lemail = document.addurl.email.value;
                var relink = document.addurl.rlu.value;
                if(lurl=="" || ltitle=="" || lemail=="" || relink==""){
                        alert('Please complete all refields.')
                        return false;
                }
                else{
                        return true;
                }
        }


function fprint(a,b){
    //alert(a +"--" + b )


    new Ajax.Request('/account/afterprint/'+ a +'?item2='+ b + '', {asynchronous:true});


}


function stop_indicator(){

    var obj= document.getElementById("indicator");
    obj.style.display = "none";
}

function changeimg(folder,img) {
    var obj= document.getElementById("imagecontainer");
    obj.style.background = 'url("/images/products/' + folder + '/' + img + '")'
    var id = img.replace(/.jpg/g, "");
    id = id.toLowerCase()
    new Ajax.Request('/change/getiteminfo/'+ id  + '', {asynchronous:true});

}

function centerFlash() {
    //    if(document.documentElement.clientHeight < 725) {
    // window.location = "#silver-home"
    // }
    window.setTimeout("window.open ('/latest_designs.html', '_parent')", 20000);
}

