//1k DHTML API
d=document;l=d.layers;op=navigator.userAgent.indexOf('Opera')!=-1;
function gE(e,f){if(l){f=(f)?f:self;var V=f.document.layers;if(V[e])return V[e];for(var W=0;W<V.length;)t=gE(e,V[W++]);return t;}if(d.all)return d.all[e];return d.getElementById(e);}
function sE(e){l?e.visibility='show':e.style.visibility='visible';}
function hE(e){l?e.visibility='hide':e.style.visibility='hidden';}
function sZ(e,z){l?e.zIndex=z:e.style.zIndex=z;}
function sX(e,x){l?e.left=x:op?e.style.pixelLeft=x:e.style.left=x;}
function sY(e,y){l?e.top=y:op?e.style.pixelTop=y:e.style.top=y;}
function sW(e,w){l?e.clip.width=w:op?e.style.pixelWidth=w:e.style.width=w;}
function sH(e,h){l?e.clip.height=h:op?e.style.pixelHeight=h:e.style.height=h;}
function sC(e,t,r,b,x){l?(X=e.clip,X.top=t,X.right=r,X.bottom=b,X.left=x):e.style.clip='rect('+t+' '+r+' '+b+' '+x+')';}
function wH(e,h){if(l){Y=e.document;Y.open();Y.write(h);Y.close();}else if(e.innerHTML)e.innerHTML=h;}
function dsE(e){l?e.display='':e.style.display='';}
function dhE(e){l?e.display='none':e.style.display='none';}
function gY(e){var y=0;l?y=e.top:op?y=e.style.pixelTop:y=e.style.top;return y;}
function gX(e){var x=0;l?x=e.left:op?x=e.style.pixelLeft:x=e.style.left;return x;}
//Simple Ajax Call
function xmlhttpPost(strURL, strVal, strDiv, funcCallBack) 
{
    var xmlHttpReq = false;
    var self = this;
    // Mozilla/Safari
    if (window.XMLHttpRequest) 
    {
        self.xmlHttpReq = new XMLHttpRequest();
    }
    // IE
    else if (window.ActiveXObject) 
    {
        self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
    }
    self.xmlHttpReq.open('POST', strURL, true);
    self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    self.xmlHttpReq.onreadystatechange = function() 
    {
        if (self.xmlHttpReq.readyState == 4) 
        {
            var e = gE(strDiv);
            if (e != null)
            {
                wH(e,self.xmlHttpReq.responseText);
            }
            if (funcCallBack != null)
            {
                funcCallBack(self.xmlHttpReq.responseText);
            }
        }
    }
    self.xmlHttpReq.send(strVal);
}
var curTab = "1";
function showTab(id){
    
   var cid = gE("opt" + id);
   var tid = gE("menu" + id); 
   if (cid != null && tid != null)
   {
        var oid = gE("opt" + curTab);
        if (oid != null) dhE(oid);
        var otid = gE("menu" + curTab);
        if (otid != null) otid.className="menu";       
        dsE(cid);
        curTab = id;
        tid.className="menu active";
   }
}
function formatCurrency(num) 
{
    num = num.toString().replace(/\$|\,/g,'');
    if(isNaN(num))num = "0";
    sign = (num == (num = Math.abs(num)));num = Math.floor(num*100+0.50000000001); cents = num%100;
    num = Math.floor(num/100).toString();
    if(cents<10) cents = "0" + cents;
    for (var i = 0; i < Math.floor((num.length-(1+i))/3); i++)
         num = num.substring(0,num.length-(4*i+3))+','+num.substring(num.length-(4*i+3));
    return (((sign)?'':'-') + '$' + num + '.' + cents);
}

function isFlashInstalled(reqVersion)
{
    var ret = false;
    var MM_contentVersion = reqVersion;
    var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
    if ( plugin ) {
		    var words = navigator.plugins["Shockwave Flash"].description.split(" ");
	        for (var i = 0; i < words.length; ++i)
	        {
		    if (isNaN(parseInt(words[i])))
		    continue;
		    var MM_PluginVersion = words[i]; 
	        }
	    var MM_FlashCanPlay = MM_PluginVersion >= MM_contentVersion;
    }
    else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 
       && (navigator.appVersion.indexOf("Win") != -1)) {
	    document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n'); //FS hide this from IE4.5 Mac by splitting the tag
	    document.write('on error resume next \n');
	    document.write('MM_FlashCanPlay = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & MM_contentVersion)))\n');
	    document.write('</SCR' + 'IPT\> \n');
    }
    if ( MM_FlashCanPlay ) {
	    ret = true;
    }
    return ret;
}
var curTab = "1";
function showTab(id){
    
   var cid = gE("opt" + id);
   var tid = gE("menu" + id); 
   if (cid != null && tid != null)
   {
        var oid = gE("opt" + curTab);
        if (oid != null) dhE(oid);
        var otid = gE("menu" + curTab);
        if (otid != null) otid.className="menu";       
        dsE(cid);
        curTab = id;
        tid.className="menu active";
   }
}
function pop(url, title){window.open (url, title,'left=20,top=20,width=500,height=500,toolbar=1,resizable=1,scrollbars=1');}
function showHelp() {var o = gE('divHelp');if (o != null) dsE(o);};
function hideHelp() {var o = gE('divHelp');if (o != null) dhE(o);};

function shdiv(divid)
{
    var o = gE('shlink_' + divid);
    var i = gE('inp_' + divid);
    var e = gE('div_' + divid);
    if (i!=null)
    {
        if (i.value==1)
        {
            if (e!=null) dhE(e);
            if (o != null) wH(o, 'Show Details');
            i.value = 0;
        }
        else
        {
            if (e!=null) dsE(e);
            if (o != null) wH(o, 'Hide Details');
            i.value = 1;
        }
    }
}


/***********************************************
* Drop Down/ Overlapping Content- © Dynamic Drive (www.dynamicdrive.com)
* This notice must stay intact for legal use.
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/
function getposOffset(overlay, offsettype)
{
    var totaloffset=(offsettype=="left")? overlay.offsetLeft : overlay.offsetTop;
    var parentEl=overlay.offsetParent;
    while (parentEl!=null)
    {
        totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
        parentEl=parentEl.offsetParent;
    }
    return totaloffset;
}

function overlay(curobj, subobjstr, opt_position)
{
    if (document.getElementById)
    {
        var subobj=document.getElementById(subobjstr);
        subobj.style.display=(subobj.style.display!="block")? "block" : "none";
        var xpos=getposOffset(curobj, "left")+((typeof opt_position!="undefined" && opt_position.indexOf("right")!=-1)? -(subobj.offsetWidth-curobj.offsetWidth) : 0) ;
        var ypos=getposOffset(curobj, "top")+((typeof opt_position!="undefined" && opt_position.indexOf("bottom")!=-1)? curobj.offsetHeight : 0);
        subobj.style.left=xpos+"px";
        subobj.style.top=ypos+"px";
        return false;
    }
    else
        return true;
}

function overlayclose(subobj){
document.getElementById(subobj).style.display="none";
}


