
     var preloadImageArray = Array();
	 var popupFaqFlashWin = null;
	 var popupPowerMoveWin = null;
	 
	 
	 function initializePageGlobal(){
			enlargeRightColumn();
			preloadImages();
    	}
	 
	 function ConstructTooltip() {

                var tooltip_body_str_1 = "<table cellpadding=\'0\' cellspacing=\'0\' border=\'0\'><tr valign=\'top\'><td width=\'6\' height=\'6\'>";
                var tooltip_body_str_2 = "</tr></td></table>";
                var tooltip_buffer;

                tooltip_buffer = tooltip_body_str_1 + "Cristhian's content here "+ tooltip_body_str_2 ;
				 
                return tooltip_buffer;
    }
	 
	function txtfield_autotab( txtobj, maxchar, nexttxtfield ){
	
		if ( txtobj ) {
			if ( txtobj.value.length >= maxchar) {
				var other = document.getElementById( nexttxtfield);
				if ( other ){
					other.focus();
				}
			}
		}
			
	
	}
	
	
	/* Enlarge right column, to make it expand all the way down (to the footer) */
	function enlargeRightColumn(){
			//alert("here"); 
			var rightcol = document.getElementById("rightcol2content");
			if ( rightcol ) {

				var tablecenter = document.getElementById("tablecenter");
				if ( tablecenter ) {
					var aheight = getObjectHeight(tablecenter);
					rightcol.style.height =  aheight+ "px";					
				}
			}else{
				//alert("not found");
			}
		 
	 }
	 
     function preloadImages() {

			for(var loop = 0; loop < preloadImageArray.length; loop++) {
				var an_image = new Image();
				//alert("preloading " + preloadImageArray[loop] );
				an_image.src = preloadImageArray[loop];
				
			}                
    }
	
	function preloadImage( imagesrc ) {
		// Cristhian Alcantara 20060117
		// preload 1 single image only
		var an_image = new Image();
		an_image.src = imagesrc
		//alert("preloading " + imagesrc );
	}
	
	function toggleImages(thisImg, thisToggleImg) {
		// In Koo Kim 20051228
		// this method toggles the images (usually on a mouseover)
		// thisImg == image id 
		// thisToggleImg == new image relative path
		document.images[thisImg].src = thisToggleImg;
	}
	
	
	function changeFormAction( form_id , newAction ){
			var aform = document.getElementById( form_id );
			if ( aform ) {
				
				aform.action = newAction
			}
	}
	
	function toggleImageButton( obj, newimg ) {
		
		var obj = document.getElementById( obj) 
		if ( obj) {
			obj.src = newimg;
		}
	}
	
	
	/* Not necessarily an div */
	
	function getObjectHeight( divobj ){

			var height = 0;
		
			if ( !divobj ){
				alert("error");
			}
		
			if(divobj.offsetHeight){ 	
		
				height = divobj.offsetHeight;
				
			}else if(divobj.style.pixelHeight){ 	
				height = divobj.style.pixelHeight;
			}
		
			else if(divobj.style.height){ 	
				height = divobj.style.height;
			}
		
			//alert( "height is " + height );
		
			return height;
  }


   function TooltipConfig(e, width, xOffset, yOffset, above) {
                // In Koo Kim 20060104
                // the following configures the wz_tooltip
                if (xOffset && xOffset != null) {
                    e.T_OFFSETX=xOffset;
                } else {
                    e.T_OFFSETX=10;
                    e.T_OFFSETY=10;
                }
                if (yOffset && yOffset != null) {
                    e.T_OFFSETY=yOffset;
                } else {
                    e.T_OFFSETY=10;
                }
                if (above && above != null) {
                    e.T_ABOVE=above;
                }
                e.T_DELAY = 300;
                e.T_BGCOLOR='';
                e.T_BGIMG='';
                e.T_BORDERWIDTH=0;
                e.T_BORDERCOLOR='';
                e.T_FONTCOLOR='#333333';
                e.T_FONTFACE='Verdana, Geneva, Arial, Helvetica, sans-serif';
                e.T_FONTSIZE='12px';
                e.T_OPACITY=100;
                e.T_PADDING=0;
                e.T_STATIC=true;
                e.T_TEXTALIGN='right';
                e.T_TITLE='';
                e.T_TITLECOLOR='#ff6666';
                e.T_WIDTH=width;
                return e;
            }
            function TooltipKeyword(keyword, definition) {
                // In Koo Kim 200605
                // this js object delivers the keyword and definition
                // to the tooltip constructor
                this.keyword=keyword;
                this.definition=definition;
            }
            function ConstructTooltip(tooltipKeyObj) {
                // In Koo Kim 200605
                // this method accepts a TooltipKeyword object
                // and constructs the tooltip table as a string
                //var tooltip_body_str_1 = "<table cellpadding=\'0\' cellspacing=\'0\' border=\'0\'><tr valign=\'top\'><td width=\'6\' height=\'6\'><img src=\'\/images\/blue_corner_ul.gif\' width=\'6\' height=\'6\' border=\'0\'><\/td><td class=\'barker_t\'><img src=\'\/images\/shim.gif\' width=\'1\' height=\'6\' border=\'0\'><\/td><td width=\'6\'><img src=\'\/images\/blue_corner_ur.gif\' width=\'6\' height=\'6\' border=\'0\'><\/td><\/tr><tr><td class=\'barker_l\' width=\'6\'><img src=\'\/images\/shim.gif\' width=\'6\' height=\'1\' border=\'0\'><\/td><td bgcolor=\'#FEFEE5\'><table cellpadding=\'3\' cellspacing=\'0\' border=\'0\' width=\'100%\'><tr><td><table cellpadding=\'1\' cellspacing=\'0\' border=\'0\' width=\'100%\'><tr><td class=\'barker_body\' colspan=\'2\'><span class=\'tooltip_highlight\'>";
                //var tooltip_body_str_2 = "<\/span>&nbsp;&nbsp;";
                //var tooltip_body_str_3 = "<\/td><\/tr><tr valign=\'bottom\'><td class=\'barker_foot\' nowrap>For a full list of terms, visit our Glossary<\/td><td width=\'18\'><img src=\'\/images\/i_icon.gif\' width=\'18\' height=\'14\' border=\'0\'><\/td><\/tr><\/table><\/td><\/tr><\/table><\/td><td class=\'barker_r\'><img src=\'\/images\/shim.gif\' width=\'6\' height=\'1\' border=\'0\'><\/td><\/tr><tr valign=\'top\'><td width=\'6\' height=\'6\'><img src=\'\/images\/blue_corner_ll.gif\' width=\'6\' height=\'6\'><\/td><td class=\'barker_b\'><img src=\'\/images\/shim.gif\' width=\'1\' height=\'6\' border=\'0\'><\/td><td><img src=\'\/images\/blue_corner_lr.gif\' width=\'6\' height=\'6\' border=\'0\'><\/td><\/tr><\/table>";
                var tooltip_buffer;
                //if (tooltipKeyObj.keyword != '') {
                  //  tooltip_buffer = tooltip_body_str_1 + tooltipKeyObj.keyword + tooltip_body_str_2 + tooltipKeyObj.definition + tooltip_body_str_3;
                //} else {
                    //tooltip_buffer = tooltip_body_str_1 + tooltipKeyObj.definition + tooltip_body_str_3;
                //}
				
                tooltip_buffer = tooltipKeyObj.keyword + "<Br>" + tooltipKeyObj.definition;
				
                return tooltip_buffer;
            }
			
			
			
			function openFaqFlashModule(  ) {
	  	
						var url = "faq.html";
						var nWidth = 645;
						var nHeight = 486;
						var x = (screen.width - nWidth) / 3;
						var y = (screen.height - nHeight) / 3;		
			
						var optionString = "scrollbars=yes,location=no,resizable=yes,status=no,";
						optionString += "height=" + nHeight + ",width=" + nWidth;
						optionString += ",screenX="+ x +",screenY="+ y +",top="+ y +",left="+ x;
			
						if (! popupFaqFlashWin || popupFaqFlashWin.closed ) {
							popupFaqFlashWin = window.open(url,"popupFaqFlashWin",optionString);
						} else {
							// window already exists, so bring it forward
							popupFaqFlashWin.location.href=url;
							popupFaqFlashWin.focus();
						}
			}

		function changeOpac(opacity, objectid) { 
	
		
				object = document.getElementById( objectid );

				if ( object ) {
				
					object.style.opacity = (opacity / 100); 
					object.MozOpacity = (opacity / 100); 
					object.KhtmlOpacity = (opacity / 100); 
					object.filter = "alpha(opacity=" + opacity + ")"; 
					object.style.filter = "alpha(opacity=" + opacity + ")"; 
				}		
				
		 }				

			
			function openPowerMoveConditions(  ) {
	  	
						var url = "powermovedisclaimer.asp?print=true";
						var nWidth = 645;
						var nHeight = 486;
						var x = (screen.width - nWidth) / 3;
						var y = (screen.height - nHeight) / 3;		
			
						var optionString = "scrollbars=yes,location=no,resizable=yes,status=no,";
						optionString += "height=" + nHeight + ",width=" + nWidth;
						optionString += ",screenX="+ x +",screenY="+ y +",top="+ y +",left="+ x;
			
						if (! popupPowerMoveWin || popupPowerMoveWin.closed ) {
							popupPowerMoveWin = window.open(url,"popupPowerMoveWin",optionString);
						} else {
							// window already exists, so bring it forward
							popupPowerMoveWin.location.href=url;
							popupPowerMoveWin.focus();
						}
			}
			
			
			function validateInternalToolForm(){
				
				var loc = document.getElementById("loc");
				var ser = document.getElementById("ser");
				
				
				if ( !ser || ser.value == 0 ) {
					alert("Please select the Desired Service");
					return false;
				}
				if ( !loc || loc.value == 0 ) {
					alert("Please select the location");
					return false;
				}
				
				return true;
			}
			
			function validateHomeSearchForm(){
			
				var cus = document.getElementById("cus");
				var loc = document.getElementById("loc");
				var ser = document.getElementById("ser");
				
				if ( !cus || cus.value == 0 ) {
					alert("Please select a Type of Customer");
					return false;
				}
				if ( !ser || ser.value == 0 ) {
					alert("Please select the Desired Service");
					return false;
				}
				if ( !loc || loc.value == 0 ) {
					alert("Please select the location");
					return false;
				}
				
				return true;
			}
			
			
			function submitHomeSearchForm(){
				//var aform = document.getElementById("searchform")
				//if ( aform  ){
				//	if ( validateHomeSearchForm() ) {
				//		//alert("wil submit");
				//		aform.submit()	
				//	}
				//}
				
				if ( validateHomeSearchForm() ) {
					return true;
				}else{
					return false;
				}
				
			}
			
			
			function common_showLearnDiv( flag ){
			
				var div1 = document.getElementById( 'learndiv' );
				if ( div1 ) {
					if ( flag) {
						div1.style.display = "block";
					}else{
						div1.style.display = "none";
					}
				}
			}
			
			
			function common_showLearnDiv2( flag ){
				
				var div1 = document.getElementById( 'learndiv2' );
				if ( div1 ) {
					if ( flag) {
						div1.style.display = "block";
					}else{
						div1.style.display = "none";
					}
				}
				
			}
			

	var flashVersion = 0;
	
	function getFlashVersion ( ) {
		
			/*
			for(var i=7; i>0; i--){
				flashVersion = 0;
				try{
					var flash = new ActiveXObject("ShockwaveFlash.ShockwaveFlash." + i);
					flashVersion = i;
				}
				catch(e){
						var r = '';
						for (var p in e)
						  r += p + ': ' + e[p] + '\n';
						alert(r);

				}
			}
			return flashVersion;
			*/
			var flashinstalled = 0;
			var flashversion = 0;
			MSDetect = "false";
			if (navigator.plugins && navigator.plugins.length)
			{
				x = navigator.plugins["Shockwave Flash"];
				if (x)
				{
					flashinstalled = 2;
					if (x.description)
					{
						y = x.description;
						flashversion = y.charAt(y.indexOf('.')-1);
					}
				}
				else
					flashinstalled = 1;
				if (navigator.plugins["Shockwave Flash 2.0"])
				{
					flashinstalled = 2;
					flashversion = 2;
				}
			}
			else if (navigator.mimeTypes && navigator.mimeTypes.length)
			{
				x = navigator.mimeTypes['application/x-shockwave-flash'];
				if (x && x.enabledPlugin)
					flashinstalled = 2;
				else
					flashinstalled = 1;
			}
			else{
				MSDetect = "true";
			}
			
			return flashversion 
			
	}
	

