﻿// JScript File /*--- 20080514 | cly ---*/

function showhideByID(idname){var x = getE(idname);if(x.style.display=="block"){x.style.display="none";}else{x.style.display="block";}} function goForm(url, name, val){if(name=="") return;var frm = document.forms["goForm"];frm.action=url;f=document.createElement("input");f.setAttribute("id",name);f.setAttribute("type","hidden");f.setAttribute("name",name);f.setAttribute("value",val);frm.appendChild(f);frm.submit();}function goSearch(url,kw){if(kw=="")return;var frm = document.forms["goSearch"];frm.action=url;f=document.createElement("input");f.setAttribute("id","as_q");f.setAttribute("type","hidden");f.setAttribute("name","as_q");f.setAttribute("value",kw);frm.appendChild(f);f=document.createElement("input");f.setAttribute("id","sitesearch");f.setAttribute("type","hidden");f.setAttribute("name","sitesearch");f.setAttribute("value","www.installogy.com");frm.appendChild(f);frm.submit();}
function goFormPP(biz, iname, inum, amt, nurl, s, isEn)
{
    var ty = "thanks.aspx"; if(!isEn)ty="fr/merci.aspx";
    var frm = document.forms["frmPP"];
    frm.action="https://www.paypal.com/cgi-bin/webscr";
    f=document.createElement("input");f.setAttribute("name","cmd");f.setAttribute("value","_xclick");frm.appendChild(f);
    f=document.createElement("input");f.setAttribute("name","business");f.setAttribute("value",biz);frm.appendChild(f);
    f=document.createElement("input");f.setAttribute("name","item_name");f.setAttribute("value",iname);frm.appendChild(f);
    f=document.createElement("input");f.setAttribute("name","item_number");f.setAttribute("value",inum);frm.appendChild(f);
    f=document.createElement("input");f.setAttribute("name","amount");f.setAttribute("value",amt);frm.appendChild(f);
    f=document.createElement("input");f.setAttribute("name","no_shipping");f.setAttribute("value","2");frm.appendChild(f);
    f=document.createElement("input");f.setAttribute("name","no_note");f.setAttribute("value","1");frm.appendChild(f);
    f=document.createElement("input");f.setAttribute("name","return");f.setAttribute("value","http://www.installogy.com/"+ty);frm.appendChild(f);
    f=document.createElement("input");f.setAttribute("name","cancel_return");f.setAttribute("value","http://www.installogy.com");frm.appendChild(f);
    f=document.createElement("input");f.setAttribute("name","notify_url");f.setAttribute("value",nurl);frm.appendChild(f);
    f=document.createElement("input");f.setAttribute("name","currency_code");f.setAttribute("value","USD");frm.appendChild(f);
    f=document.createElement("input");f.setAttribute("name","lc");f.setAttribute("value","CA");frm.appendChild(f);
    f=document.createElement("input");f.setAttribute("name","bn");f.setAttribute("value","PP-BuyNowBF");frm.appendChild(f);
    if(s!="") { f=document.createElement("input");f.setAttribute("name","custom");f.setAttribute("value",s);frm.appendChild(f); }
    frm.submit();
}
function goFormPPSandbox(biz, iname, inum, amt, nurl, s, isEn)
{
    var ty = "thanks.aspx"; if(!isEn)ty="fr/merci.aspx";
    var frm = document.forms["frmPP"];
    frm.action="https://www.sandbox.paypal.com/cgi-bin/webscr";
    f=document.createElement("input");f.setAttribute("name","cmd");f.setAttribute("value","_xclick");frm.appendChild(f);
    f=document.createElement("input");f.setAttribute("name","business");f.setAttribute("value",biz);frm.appendChild(f);
    f=document.createElement("input");f.setAttribute("name","item_name");f.setAttribute("value",iname);frm.appendChild(f);
    f=document.createElement("input");f.setAttribute("name","item_number");f.setAttribute("value",inum);frm.appendChild(f);
    f=document.createElement("input");f.setAttribute("name","amount");f.setAttribute("value",amt);frm.appendChild(f);
    f=document.createElement("input");f.setAttribute("name","no_shipping");f.setAttribute("value","2");frm.appendChild(f);
    f=document.createElement("input");f.setAttribute("name","no_note");f.setAttribute("value","1");frm.appendChild(f);
    f=document.createElement("input");f.setAttribute("name","return");f.setAttribute("value","http://www.installogy.com/"+ty);frm.appendChild(f);
    f=document.createElement("input");f.setAttribute("name","cancel_return");f.setAttribute("value","http://www.installogy.com");frm.appendChild(f);
    f=document.createElement("input");f.setAttribute("name","notify_url");f.setAttribute("value",nurl);frm.appendChild(f);
    f=document.createElement("input");f.setAttribute("name","currency_code");f.setAttribute("value","USD");frm.appendChild(f);
    f=document.createElement("input");f.setAttribute("name","lc");f.setAttribute("value","CA");frm.appendChild(f);
    f=document.createElement("input");f.setAttribute("name","bn");f.setAttribute("value","PP-BuyNowBF");frm.appendChild(f);
    if(s!="") { f=document.createElement("input");f.setAttribute("name","custom");f.setAttribute("value",s);frm.appendChild(f); }
    frm.submit();
}
function getE(id){return document.getElementById(id);}
function keypressEnter(e){
var characterCode;
if(e && e.which){e=e;characterCode=e.which;}
else{e=event;characterCode=e.keyCode;}
if(characterCode == 13){return true}else{return false;}
}
function showImage(holderid,imgid,src)
{
    getE(imgid).src=src;
    getE(holderid).style.display="block";
}