

function drawSearchBox(){
    document.write('<input type="text" style="width: 170px; color: #aaa; font-size: 11px;" name="q" id="q" value="e.g. \'load cell amplifier\'" onclick="this.value=\'\';this.style.color=\'#111\'" />');
}

function drawLoginBox(){
    document.write('<a class="toplink" href="#" onclick="showHide(\'blockscreen\',\'loginholder\');" style="background-image: url(images/icons/key.gif);background-repeat: no-repeat;background-position: 2px 9px; padding-left: 22px;">Login</a>');
}

function checkCheckBox(f){
    if (f.agree.checked==false ){
        alert('Please accept the Terms & Conditions.');
        return false;
    }
    else return true;
}



function popUp(URL) {
    day = new Date();
    id = day.getTime();
    eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=810,height=610');");
}



function showHide(DIVNAME,DIVNAME2){
    if(document.getElementById(DIVNAME).style.display=='block'){
        document.getElementById(DIVNAME).style.display='none';
    }
    else{
        var powerslide = new Spry.Effect.Slide(DIVNAME,{duration:800,from:'0%', to:'100%', horizontal: true});
        powerslide.start();
    }

    if(document.getElementById(DIVNAME2).style.display=='block'){
        document.getElementById(DIVNAME2).style.display='none';
    }
    else{
        document.getElementById(DIVNAME2).style.display='block';
        var powerslide2 = new Spry.Effect.Slide('login',{duration:800,from:'0%', to:'100%', horizontal: true});
        powerslide2.start();
    }
}

function showHide2(DIVNAME){
    if(document.getElementById(DIVNAME).style.display=='block'){
        document.getElementById(DIVNAME).style.display='none';
    }
    else{
        document.getElementById(DIVNAME).style.display='block';

    }
}



function goToProduct(id){
    location.href='product.php?id='+id+'#faq';
}

function goToProductFaq(id){
    location.href='faqs.php?product_id='+id;
}

function goToProductDL(id){
    location.href='product.php?id='+id+'#downloads';
}









function ToggleDeleteOptions(ref){
    adiv=document.getElementById(ref);
    bdiv=document.getElementById(ref+'_box');
    if(bdiv.style.display=='block'){
        bdiv.style.display='none';
        adiv.innerHTML='deleted!';
    }
    else{
        bdiv.style.display='block';
        adiv.innerHTML='back';
    }
}

function ConfirmDelete(disappear){
    var confirmer=confirm("Do you really want to delete this option?");
    if(confirmer){
        //document.getElementById(disappear+'_box').style.visbility='hidden';
        var powerslide = new Spry.Effect.Slide(disappear+'_box',{duration:800,from:'100%', to:'0%'});
        powerslide.start();
    }
    else{

    }
}

function clearCurrentDefaults(connName,connCount,switchOn){
    //document.write('connName:'+connName+' connCount:'+connCount+' switchOn:'+switchOn);
    var ind=0;
    for (ind=0;ind<connCount;ind++){
        var inpName=connName+ind+'_setdef';
        var editName=connName+ind+'_edit';
        var imgName=connName+ind+'_img';
        document.forms['poptions'].elements[inpName].value='NO';
        document.forms['poptions'].elements[editName].value='1';
        document[imgName].src='../images/icons/bullet_black.png';
    }
    document.forms['poptions'].elements[switchOn+'_setdef'].value='YES';
    document.forms['poptions'].elements[switchOn+'_edit'].value='1';
    document[switchOn+'_img'].src='../images/icons/bullet_add.png';
}

