// We start with basic functions for image rollovers, etc, the follow with HTML substitution functions

var $jQ = jQuery.noConflict();

sfHover = function() {
    var sfEls = document.getElementById("mainNav").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"), "");
        }
    }
}

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


// HTML substitution functions follow

function setCopyright(){
    $jQ('.copyright').html('\
<span class="copyrightText">Power Products is a partner company of <a href="http://www.globalei.com">Global Energy Innovations</a> &copy; 1981-2012 All Rights Reserved.</span>\
');
}

function setBanner(){
    $jQ('.banner').html('\
	<div class="logo">\
		<a href="index.html">\
        	<img src="images/banner-logo.png" alt="Power Products Banner" align="left" class="logoImg"/>\
		</a>\
	</div>\
	<div id="search" style="float:right; padding-top:31px; padding-right:15px;">\
		<form action="search.html" id="cse-search-box">\
			<div>\
				<input type="hidden" name="cx" value="017194008038640236424:snr8kbwtvia" />\
				<input type="hidden" name="cof" value="FORID:9" />\
				<input type="hidden" name="ie" value="UTF-8" />\
				<input type="text" name="q" size="31" />\
				<input type="submit" name="sa" value="Search" />\
			</div>\
		</form>\
		<script type="text/javascript" src="http://www.google.com/cse/brand?form=cse-search-box&lang=en"></script>\
	</div>\
	<div class="clearfloat"></div>\
');
}

function setMainSite_mainNav(section){
    var str = '<div class="navbar">\
    <div class="navbar_inner">\
      <div class="navbar_inner2">\
        <div id="topNavId" class="navbar_inner3">\
          <ul class="topNavUL">';
	    if (section == "home") {
			str = str + '<li class="home"><a href="index.html" class="homeLink"> Home </a>'
		} else {
			str = str + '<li><a href="index.html"> Home </a>';
		}
		str = str + '<div>\
                <ul>\
                  \
                </ul>\
              </div>\
            </li>';
		
    if (section == "products") {
			str = str + '<li class="products"><a href="products.html" class="productsLink"> Products </a>';
		} else {
			str = str + '<li><a href="products.html">Products</a>';
		}
		str = str + '<div>\
                <ul>\
                  <li><a href="chargers.html">Battery Chargers</a></li>\
				  <li><a href="analyzers.html">Battery Analyzers</a></li>\
                  <li><a href="equipment.html">Motor Temp. Monitors</a></li>\
				  <li><a href="accessories.html">Accessories and Spare Parts</a></li>\
				  <li><a href="videos.html">Videos</a></li>\
                </ul>\
              </div>\
            </li>';
		if (section == "industries") {
			str = str + '<li class="industries"><a href="industries.html" class="industriesLink"> Industries</a>';
		} else {
			str = str + '<li><a href="industries.html">Industries</a>';
		}
		str = str + '<div>\
                <ul>\
                  <li><a href="industries.html#Military ">Military </a></li>\
                  <li><a href="industries.html#Aviation">Aviation</a></li>\
                </ul>\
              </div>\
			</li>';
		if (section == "where") {
			str = str + '<li class="whereToBuy"><a href="whereToBuy.html" class="whereToBuyLink"> Where to Buy </a>';
		} else {
			str = str + '<li><a href="whereToBuy.html">Where to Buy</a>';
		}
		str = str + '<div>\
                <ul>\
                  <li><a href="distributorsAndReps.html">Distributors & Representatives</a></li>\
                  <li><a href="PowerProductsSales.html">Power Products Sales</a></li>\
                </ul>\
              </div>\
			</li>';
			if (section == "support") {
			str = str + '<li class="support"><a href="support.html" class="support"> Support </a>';
		} else {
			str = str + '<li><a href="support.html">Support</a>';
		}
		str = str + '<div>\
                <ul>\
				<li><a href="support.html">Customer & Partner Support</a></li>\
				<li><a href="repairsCalibrations.html">Repairs & Calibrations</a></li>\
                </ul>\
              </div>\
			</li>';
		if (section == "about") {
			str = str + '<li class="aboutUs"><a href="aboutUs.html" class="aboutUsLink"> About Us </a>';
		}
		else {
			str = str + '<li><a href="aboutUs.html"> About Us </a>';
		}
        str = str + '<div>\
                <ul>\
                  <li><a href="aboutUs.html">About Us</a></li>\
                  <li><a href="taxInformation.html">Tax Information</a>\
				  <li><a >Legal</a>\
					  <div>\
						<ul>\
						  <li><a href="termsAndCondition.html">Terms and Condition</a></li>\
						  <li><a href="privacyStatement.html">Privacy Statement</a></li>\
						  <li><a href="disclaimer.html">Disclaimer</a></li>\
						</ul>\
					  </div>\
				  </li>\
                </ul>\
              </div>\
            </li>';
		if (section == "contact") {
			str = str + '<li class="contactUs"><a href="contactUs.html" class="contactUsLink"> Contact Us </a>';
		}
		else {
			str = str + '<li><a href="contactUs.html"> Contact Us </a>';
		}
        str = str + '<div>\
                <ul>\
                </ul>\
              </div>\
            </li>\
          </ul>\
          <div class="clearfloatTopNav">&nbsp;</div>\
          <!--[if lte IE 6]>\
<style>\
.navbar_inner3 ul ul li {float:left; clear: both; width: 100%;}.navbar_inner3 {text-align: left;}.navbar_inner3, .navbar_inner3 ul ul a {zoom: 1;}\
.navbar_inner3 ul ul {border: 1px solid #fff; filter: alpha(opacity=90);background-color: #d3d3d3; !important;}\
.navbar_inner3 ul ul a, .navbar_inner3 ul ul li {background-image: none !important;}\
.navbar_inner3 ul ul a {padding: 6px 12px !important;}\
.navbar_inner3 ul ul a:hover {background-color: #999999 !important;}\
.navbar_inner3 ul ul a.trig_open {background-color: #999999 !important; color: #fff;}\
.navbar_inner3 ul ul a.trig_closed {background-image: url(images/topNav_pullDown_middle.png) !important; background-repeat: no-repeat; background-position: right center;}\
</style>\
<![endif]-->\
          <!--[if IE 5]>\
<style>.navbar_inner3, .navbar_inner3 ul ul a {height: 1%; overflow: visible !important;} .navbar_inner3 {width: 100%;}</style>\
<![endif]-->\
          <!--[if IE 7]>\
<style>.navbar_inner3, .navbar_inner3 a{zoom:1;}.navbar_inner3 ul ul li{float:left;clear:both;width:100%;}</style>\
<![endif]-->\
        </div>\
        <div class="clearfloat">&nbsp;</div>\
      </div>\
    </div>\
  </div>';

    $jQ('#mainNav').html(str);
	
	pulldownOptions('topNavId',1,1,-10,-20,0,0,0,1,0,3,1,1,0);

}

function setSoftwareDownloadImage(){
    $jQ('.softwareDownload').html('\
		<a href="http://www.globalei.com/bms/software-firmware/ibms-companion-software-free-download.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage(\'Software Download\',\'\',\'images/softwareDownload-2.png\',1)">\
			<img src="images/softwareDownload-1.png" alt="Software Download" name="Software Download" width="202" height="162" border="0" id="Software Download" />\
		</a>\
	');
}
function setEC1000FeatureActivationImage(){
    $jQ('.ec1000FeatureActivationImage').html('\
        <a href="http://www.globalei.com/license" onmouseout="MM_swapImgRestore()" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage(\'Feature Activation\',\'\',\'images/featureActivation-2.png\',1)">\
		<img src="images/featureActivation-1.png" name="Feature Activation" width="164" height="297" border="0" id="Feature Activation" /></a>\
	');
}

var initializedAlready=false,intializationCompleted=false,control=[],adv=[];

function pulldownOptions(){
	if(!document.getElementById){
		return;
	}
	control[control.length]=arguments;
}
function initializeTopNav(){
	var i,j,jj,k,tM,tA,tU,lv,pp,clv,fs,tS,d=1,cl,tp,uh=0,cN,tD,tN,iM,tw,ow,oh;
	if(initializedAlready){
		return;
	}
	initializedAlready=true;
	for(k=0;k<control.length;k++){
		tM=document.getElementById(control[k][0]);
		if(tM){
			tM.option=control[k];
			if(window.opera||navigator.appVersion.indexOf("MSIE 5")>-1){
				tM.option[2]=0;
			}
			tM.timeout=null;
			tD=tM.getElementsByTagName("DIV");
			for(i=0;i<tD.length;i++){
				tD[i].setAttribute("id",tM.id+'d'+(i+2));
				tD[i].state='closed';
				tD[i].topNavMenu=tM.id;
			}
			tU=tM.getElementsByTagName("UL");
			for(i=0;i<tU.length;i++){
				tU[i].setAttribute("id",tM.id+'u'+(i+1));
				lv=1;
				pp=tU[i].parentNode;
				while(pp){
					if(pp.id&&pp.id==tM.id){
						break;
					}
					if(pp.tagName&&pp.tagName=="UL"){
						lv++;
					}
					pp=pp.parentNode;
				}
				tU[i].level=lv;
				clv='level_'+lv;
				setClass(tU[i],clv);
				tN=tU[i].childNodes;
				if(tN){
					fs=-1;
					jj=0;
					for(j=0;j<tN.length;j++){
						if(tN[j].tagName&&tN[j].tagName=="LI"){
							jj++;
							tA=tN[j].getElementsByTagName("A")[0];
							if(fs<0){
								setClass(tA,'firstMenuItem');
								setClass(tN[j],'firstMenuItem');
							}
							fs=j;
							tA.setAttribute("id",tM.id+'a'+(d));
							d++;
							tA.level=lv;
							tA.menuDiv=tU[i].parentNode.id;
							tA.topNavMenu=tM.id;
							if(i==0){
								setClass(tN[j],('root_'+jj));
							}
							tS=tN[j].getElementsByTagName("UL");
							if(tS&&tS.length>0){
								tA.submenu=tS[0].parentNode.id;
								tA.onmousedown=function(){
									triggerClick(this);
								};
								if(tM.option[13]==1&&lv==1){
									setClass(tA,'trig_closed_up');
									setClass(tA.parentNode,'trig_closed_up');
								}
								else if(tM.option[5]==1){
									setClass(tA,'trig_closed_left');
									setClass(tA.parentNode,'trig_closed_left');
								}
								else{
									setClass(tA,'trig_closed');
									setClass(tA.parentNode,'trig_closed');
								}
							}
							else{
								tA.submenu=false;
							}
							tA.onmouseover=function(){
								trigger(this);
							};
							tA.hasImg=false;
						}
					}
					if(fs>0){
						setClass(tA,'lastMenuItem');
						setClass(tN[fs],'lastMenuItem');
					}
				}
			}
			if(tM.option[6]==1){
				tw=tM.offsetWidth;
				oh=tM.offsetHeight;
				ow=getPropValue(tU[0],'position','position');
				tM.style.height=oh+'px';
				tU[0].style.position="absolute";
				uh=tU[0].offsetWidth;
				tU[0].style.position=ow;
				tM.style.height='auto';
				uh=(uh>=tw)?tw:uh;
				tU[0].style.marginLeft=((tw-uh)/2)+'px';
			}
			tM.onmouseout=function(evt){
				var k,rt,pp,tD,m=true;
				evt=(evt)?evt:((event)?event:null);
				if(evt){
					rt=(evt.relatedTarget)?evt.relatedTarget:evt.toElement;
					if(rt){
						pp=rt.parentNode;
						while(pp){
							if(pp&&pp.id&&pp.id.indexOf(this.id)==0){
								m=false;
								break;
							}
							pp=pp.parentNode;
						}
					}
					if(m){
						if(this.timeout){
							clearTimeout(this.timeout);
						}
						if(this.option[8]==1){
							this.timeout=setTimeout("shut('"+this.id+"')",360);
						}
						else{
							shut(this.id);
						}
					}
				}
			}
			if(tM.option[11]==1){
				currentMark(tM);
			}
		}
	}
	intializationCompleted=true;
}
function shut(d){
	var k,tM,tD;
	tM=document.getElementById(d);
	tD=tM.getElementsByTagName("DIV");
	for(k=tD.length-1;k>-1;k--){
		if(tD[k].state&&tD[k].state=='open'){
			closeDropdown(tD[k]);
		}
	}
}
function trigger(a){
	var dV;
	dV=document.getElementById(a.topNavMenu);
	if(dV.timeout){
		clearTimeout(dV.timeout);
	}
	if(a.submenu){
		if(dV.option[8]==1){
			dV.timeout=setTimeout("openSub('"+a.id+"')",160);
		}
		else{
			openSub(a.id);
		}
	}
	else{
		if(dV.option[8]==1){
			dV.timeout=setTimeout("toggle('"+a.id+"')",160);
		}
		else{
			toggle(a.id);
		}
	}
}
function openSub(d,bp){
	var i,tA,tM,tD,w,h,mT,mL,pp,xx=0,yy=0,wd,pb,pr,sct,aw,sc,pt,pl,iM;
	tA=document.getElementById(d);
	if(!bp){
		toggle(d);
	}
	if(tA.state=='open'){
		return;
	}
	tA.state='open';
	if(tA.hasImg){
		iM=tA.getElementsByTagName("IMG")[0];
		iM.state='open';
		iM.src=iM.imgswap[2];
	}
	tA.className=tA.className.replace('trig_closed','trig_open');
	tA.parentNode.className=tA.parentNode.className.replace('trig_closed','trig_open');
	tM=document.getElementById(tA.topNavMenu);
	tD=document.getElementById(tA.submenu);
	tD.trigger=tA.id;
	tD.state='open';
	tD.style.visibility="hidden";
	tD.style.display="block";
	tD.style.height='auto';
	tD.style.width='auto';
	w=tD.offsetWidth;
	h=tD.offsetHeight;
	aw=tA.parentNode.offsetWidth;
	mT=(tA.parentNode.offsetHeight*-1)+tM.option[3];
	if(tM.option[5]==1){
		mL=(w*-1)-tM.option[4];
	}
	else{
		mL=tA.offsetWidth+tM.option[4];
	}
	if(tM.option[1]==1&&tA.level==1){
		mT=0;
		mL=0;
		if(tM.option[7]==1){
			mL=((w-aw)/2)*-1;
		}
		else if(tM.option[7]==2){
			if(tA.className.indexOf('lastMenuItem')>-1){
				mL=(w-aw)*-1;
			}
			else if(tA.className.indexOf('firstMenuItem')==-1){
				mL=((w-aw)/2)*-1;
			}
			else{
				mL=0;
			}
		}
	}
	if(tM.option[13]==1){
		mT-=h;
		if(tM.option[1]==1&&tA.level==1){
			mT-=tA.offsetHeight;
		}
	}
	wd=win();
	pp=tA;
	while(pp){
		xx+=(pp.offsetLeft)?pp.offsetLeft:0;
		yy+=(pp.offsetTop)?pp.offsetTop:0;
		if(window.opera){
			if(pp.nodeName=="BODY"){
				yy-=(pp.offsetTop)?pp.offsetTop:0;
			}
		}
		pp=pp.offsetParent;
	}
	sc=document.body.parentNode.scrollTop;
	if(!sc){
		sc=document.body.scrollTop;
		if(!sc){
			sc=window.scrollY?window.scrollY:0;
		}
	}
	yy-=sc;
	sc=document.body.parentNode.scrollLeft;
	if(!sc){
		sc=document.body.scrollLeft;
		if(sc){
			sc=window.scrollX?window.scrollX:0;
		}
	}
	xx-=sc;
	pr=xx+mL+w;
	pb=yy+mT+h+tA.offsetHeight;
	if(pr>wd[1]){
		if(tM.option[1]==1&&tA.level==1){
			mL=mL-(pr-wd[1]+2);
		}
		else{
			mL=w*-1;
		}
	}
	if(pb>wd[0]){
		mT=mT-(pb-wd[0]+2);
	}
	pt=yy+mT+tA.offsetHeight;
	if(pt<0){
		mT=mT-pt+2;
	}
	pl=xx+mL;
	if(pl<0){
		mL=mL-pl+2;
	}
	tD.style.marginTop=mT+'px';
	tD.style.marginLeft=mL+'px';
	if(intializationCompleted&&tM.option[2]>0){
		var dfs,fsA,tU=tD.getElementsByTagName('UL')[0];
		fsA=tU.getElementsByTagName("A")[0];
		if(tM.option[2]==1){
			animations1(tU.id,5);
		}
		else if(tM.option[2]==2){
			dfs=getPropValue(fsA,'lineHeight','line-height');
			dfs=(dfs)?dfs:'normal';
			animations2(tU.id,5,dfs);
		}
		else if(tM.option[2]==3){
			if(tM.option[1]==1&&tU.level==2){
				dfs=getPropValue(fsA,'lineHeight','line-height');
				dfs=(dfs)?dfs:'normal';
				animations2(tU.id,5,dfs);
			}
			else{
				animations1(tU.id,5);
			}
		}
		else if(tM.option[2]==4){
			animations3(tU.id,-100);
		}
	}
	else{
		tD.style.visibility="visible";
	}
}
function toggle(d,bp){
	var i,a,tA,tD,pp;
	a=document.getElementById(d);
	pp=a.parentNode;
	while(pp){
		if(pp.tagName&&pp.tagName=="UL"){
			break;
		}
		pp=pp.parentNode;
	}
	tD=pp.getElementsByTagName("DIV");
	if(tD&&tD.length>0){
		for(i=tD.length-1;i>-1;i--){
			if(tD[i].state&&tD[i].state=='open'){
				if(!bp&&tD[i].trigger!=a.id){
					closeDropdown(tD[i]);
				}
			}
		}
	}
}
function closeDropdown(d,bp){
	var a,h,w,tM;
	a=document.getElementById(d.trigger);
	a.state='closed';
	d.state='closed';
	a.className=a.className.replace('trig_open','trig_closed');
	a.parentNode.className=a.parentNode.className.replace('trig_open','trig_closed');
	if(a.hasImg){
		iM=a.getElementsByTagName("IMG")[0];
		iM.state='closed';
		if(iM.mark){
			iM.src=iM.imgswap[3];
		}
		else{
			iM.src=iM.imgswap[0];
		}
	}
	d.style.display='none';
}
function triggerClick(a){
	var i,h,sB,tA,sh;
	h=a.getAttribute("href");
	if(h.charAt(h.length-1)=='#'||h.search(/javas/i)==0){
		sB=document.getElementById(a.submenu);
		tA=sB.getElementsByTagName('A');
		for(i=0;i<tA.length;i++){
			sh=tA[i].getAttribute('href');
			if(sh.charAt(sh.length-1)!='#'&&sh.search(/javas/i)!=0){
				a.setAttribute('href',sh);
				break;
			}
		}
	}
}
function currentMark(el){
	var j,i,k,wH,cm=false,mt=['',1,'',''],op,r1,k,kk,tA,aU,pp,a,im;;
	wH=window.location.href;
	if(el.option[12!=1]){
		wH=wH.replace(window.location.search,'');
	}
	if(wH.charAt(wH.length-1)=='#'){
		wH=wH.substring(0,wH.length-1);
	}
	for(k=0;k<adv.length;k++){
		if(adv[k][0]&&adv[k][0]==el.id){
			mt=adv[k];
			cm=true;
			break;
		}
	}
	op=mt[1];
	if(op<1){
		return;
	}
	r1=/index\.[\S]*/i;
	k=-1,kk=-1;
	tA=el.getElementsByTagName("A");
	for(j=0;j<tA.length;j++){
		aU=tA[j].href.replace(r1,'');
		if(op>0){
			if(tA[j].href==wH||aU==wH){
				k=j;
				kk=-1;
			}
		}
		if(op==2){
			if(tA[j].firstChild){
				if(tA[j].firstChild.nodeValue==mt[2]){
					kk=j;
				}
			}
		}
		if(op==3&&tA[j].href.indexOf(mt[2])>-1){
			kk=j;
		}
		if(op==4){
			for(x=2;x<mt.length;x+=2){
				if(wH.indexOf(mt[x])>-1){
					if(tA[j].firstChild&&tA[j].firstChild.nodeValue){
						if(tA[j].firstChild.nodeValue==mt[x+1]){
							kk=j;
						}
					}
				}
			}
		}
	}
	k=(kk>k)?kk:k;
	if(k>-1){
		pp=tA[k].parentNode;
		while(pp){
			if(pp.tagName&&pp.tagName=='LI'){
				setClass(pp,'li_current_mark');
				a=pp.getElementsByTagName('A');
				if(a&&a[0]){
					setClass(a[0],'current_mark');
					if(a[0].hasImg){
						im=a[0].getElementsByTagName('IMG')[0];
						im.mark=true;
						im.src=im.imgswap[3];
					}
				}
			}
			else{
				if(pp==el){
					break;
				}
			}
			pp=pp.parentNode;
		}
	}
}
function animations1(id,v,ft){
	var el,tg=100,fr=10,dy=10;
	el=document.getElementById(id);
	el.style.fontSize=v+'%';
	if(!ft){
		el.style.visibility="visible";
		el.parentNode.style.visibility="visible";
	}
	if(v!=tg){
		v+=fr;
		v=(v>=tg)?tg:v;
		setTimeout("animations1('"+id+"',"+v+",1)",dy);
	}
}
function animations2(id,v,ln,ft){
	var el,tg=120,fr=10,dy=10;
	el=document.getElementById(id);
	el.style.lineHeight=v+'%';
	if(!ft){
		el.style.visibility="visible";
		el.parentNode.style.visibility="visible";
	}
	if(v!=tg){
		v+=fr;
		v=(v>=tg)?tg:v;
		setTimeout("animations2('"+id+"',"+v+",'"+ln+"',1)",dy);
	}
	else{
		el.style.lineHeight=ln;
	}
}
function animations3(id,v,ft){
	var el,tg=0,fr=8,dy=10;
	el=document.getElementById(id);
	el.style.textIndent=v+'px';
	if(!ft){
		el.style.visibility="visible";
		el.parentNode.style.visibility="visible";
	}
	if(v!=tg){
		v+=fr;
		v=(v>=tg)?tg:v;
		setTimeout("animations3('"+id+"',"+v+",1)",dy);
	}
}
function setClass(ob,cl){
	var cc,nc,r=/\s+/g;
	cc=ob.className;
	nc=cl;
	if(cc&&cc.length>0){
		nc=cc+' '+cl;
	}
	nc=nc.replace(r,' ');
	ob.className=nc;
}

function win(){
	var h,w;
	if(document.documentElement&&document.documentElement.clientHeight){
		w=document.documentElement.clientWidth;
		h=document.documentElement.clientHeight;
	}
	else if(window.innerHeight){
		if(document.documentElement.clientWidth){
			w=document.documentElement.clientWidth;
		}
		else{
			w=window.innerWidth;
		}
		h=window.innerHeight;
	}
	else if(document.body){
		w=document.body.clientWidth;
		h=document.body.clientHeight;
	}
	return [h,w];
}
function getPropValue(ob,prop,prop2){
	var h,v=null;
	if(ob){
		if(ob.currentStyle){
			v=eval('ob.currentStyle.'+prop);
		}
		else if(document.defaultView.getComputedStyle(ob,"")){
			v=document.defaultView.getComputedStyle(ob,"").getPropertyValue(prop2);
		}
		else{
			v=eval("ob.style."+prop);
		}
	}
	return v;
}

function showImg(imgSrc, H, W, Caption) {
	var newImg = window.open("","myImg","location=no,status=no,menubar=no,directories=no,,resizable=1,height="+H+",width="+W+"");
	newImg.document.write("<title>"+ Caption +"</title>");
	newImg.document.write("<img src='"+ imgSrc +"' height='"+ H +"' width='"+ W +"' onclick='window.close()' style='position:absolute;left:0;top:0'>");
	newImg.document.write("<script type='text/javascript'> document.oncontextmenu = new Function(\"return false\") </script>");
	newImg.document.close();
}


