// GLOBALS 

var original_color;
var t;
var y = 0;
var q = 5;
var chosen_div;
var obj_top;

var array_index;
var obj_top_array = new Array(4);
obj_top_array = [15, 41, 66, 91];
obj_top_array_fix = [15, 41, 67, 93];
var q_array = new Array(4);
q_array = [0, 0, 0, 0];
var e_array = new Array(4);
var t_array = new Array(4);
var g = new Array(4);
g = [0, 0, 0, 0];
var click_ready = 0;

var version = 0;
if (navigator.appVersion.indexOf("MSIE")!=-1) {
	temp = navigator.appVersion.split("MSIE");
	version = parseFloat(temp[1]);
} 

// Files and directory structures
if (document.location.protocol == "https:") {
	var cssDir = "https://secure.hp-ww.com/country/us/en/styles/";
} else {
	var cssDir = "http://welcome.hp-ww.com/country/us/en/styles/";
}

	var NS4CSS = "hpweb_styles_ns4.css";
	var winIECSS = "hpweb_styles_win_ie6.css";
	var winIE6CSS = "hpweb_styles_win_ie6.css";
	var strdCSS = "hpweb_styles_strd.css";
	var macCSS = "hpweb_styles_mac.css";

	//  CLIENT_SIDE SNIFFER CODE
	// convert all characters to lowercase
	var agt=navigator.userAgent.toLowerCase();

	// *** BROWSER VERSION ***
	// Note: On IE5, these return 4, so use is_ie5up to detect IE5.
	var is_major = parseInt(navigator.appVersion);
	var is_minor = parseFloat(navigator.appVersion);

	// *** BROWSER TYPE ***
	var is_nav  = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1)
	            && (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1)
	            && (agt.indexOf('webtv')==-1));
	var is_nav4 = (is_nav && (is_major == 4));
	var is_nav5 = (is_nav && (is_major == 5));
	var is_nav5up = (is_nav && (is_major >= 5));
	var is_nav6 = (is_nav && (is_major == 6));
	var is_nav4up = (is_nav && (is_major >= 4));
	var is_nav6up = (is_nav && (is_major >= 6));
	var is_ie   = (agt.indexOf("msie") != -1);
	var is_ie3  = (is_ie && (is_major < 4));
	var is_ie5  = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.0")!=-1) );
	var is_ie5up  = (is_ie  && !is_ie3 && !is_ie4);
	var is_ie6    = (is_ie && (is_major == 4) && (agt.indexOf("msie 6.")!=-1) );
	var is_ie7    = (is_ie && (is_major == 4) && (agt.indexOf("msie 7.")!=-1) );
	var is_ie4  = (is_ie && (is_major <= 4) && !is_ie5 && !is_ie6 && !is_ie7);
	var is_opera = (agt.indexOf("opera") != -1);

	// *** PLATFORM ***
	var is_win   = ( (agt.indexOf("win")!=-1) || (agt.indexOf("16bit")!=-1) );
	var is_mac    = (agt.indexOf("mac")!=-1);
	var is_sun   = (agt.indexOf("sunos")!=-1);
	var is_irix  = (agt.indexOf("irix") !=-1);    // SGI
	var is_hpux  = (agt.indexOf("hp-ux")!=-1);
	var is_aix   = (agt.indexOf("aix") !=-1);      // IBM
	var is_linux = (agt.indexOf("inux")!=-1);
	var is_sco   = (agt.indexOf("sco")!=-1) || (agt.indexOf("unix_sv")!=-1);
	var is_unixware = (agt.indexOf("unix_system_v")!=-1);
	var is_mpras    = (agt.indexOf("ncr")!=-1);
	var is_reliant  = (agt.indexOf("reliantunix")!=-1);
	var is_dec   = ((agt.indexOf("dec")!=-1) || (agt.indexOf("osf1")!=-1) ||
	       (agt.indexOf("dec_alpha")!=-1) || (agt.indexOf("alphaserver")!=-1) ||
	       (agt.indexOf("ultrix")!=-1) || (agt.indexOf("alphastation")!=-1));
	var is_sinix = (agt.indexOf("sinix")!=-1);
	var is_freebsd = (agt.indexOf("freebsd")!=-1);
	var is_bsd = (agt.indexOf("bsd")!=-1);
	var is_unix  = ((agt.indexOf("x11")!=-1) || is_irix || is_sco ||
	is_unixware || is_mpras || is_reliant ||
	             is_dec || is_sinix || is_aix || is_bsd || is_freebsd);

	// Load stylesheet
	ChooseStyleSheet();

// Handle Navigator 4 window resizing
if (is_nav4up && !is_nav5up) {
   var initWidth, initHeight;
   initWidth = window.innerWidth;
   initHeight = window.innerHeight;
   window.captureEvents(Event.RESIZE);
   window.onresize = handleResize;
}

//  UTILITY FUNCTIONS
// Function to handle window resizing on Navigator 4
function handleResize() {
   if (((initWidth != window.innerWidth) || (initHeight != window.innerHeight)) && (typeof disableReload == "undefined")) {
     location.reload();
   }
   return false;
}

// Function to choose stylesheet for platform and browser version
	function ChooseStyleSheet() {
	  var fileHead = cssDir;
	  var styles;
	  if (is_win) {
		if (is_nav4) {
		    styles = fileHead + NS4CSS;
		} else if (is_ie6 || is_ie7) {
		    styles = fileHead + winIE6CSS;
		} else if (is_nav5up) {
		    styles = fileHead + macCSS;
		} else if (is_opera) {
		    styles = fileHead + macCSS;
		} else {
		    styles = fileHead + winIECSS;
		}
	  } else if (is_mac) {
		    styles = fileHead + macCSS;
	  } else if (is_linux) {
		if (is_nav4) {
		    styles = fileHead + strdCSS;
		} else {
		    styles = fileHead + macCSS;
		}
	  } else if (is_hpux) {
		if (is_ie5) {
		    styles = fileHead + macCSS;
		} else if (is_nav5up) {
		    styles = fileHead + macCSS;
		} else {
		    styles = fileHead + strdCSS;
		}
	  } else if (is_sun) {
		if (is_nav4) {
		    styles = fileHead + NS4CSS;
		} else {
		    styles = fileHead + strdCSS;
		}
	  // Created by Tru 64 Team - added 09/04
	  } else if (is_dec) {
		if (is_nav4) {
		    styles = fileHead + NS4CSS;
		} else if (is_nav5up) {
		    styles = fileHead + macCSS;
		} else {
		    styles = fileHead + strdCSS;
		}
	  } else {
		styles = fileHead + strdCSS;
	  }
	  document.write("<link rel=\"stylesheet\" type=\"text/css\" href=\"" + styles + "\">");
	  return true;
	}

function setTheme()
{
    var secondaryTheme;
    if ( theme == '#0066FF' ) { secondaryTheme = '#99CCFF'; }
    if ( theme == '#990000' ) { secondaryTheme = '#CC9999'; }
    if ( theme == '#CC0066' ) { secondaryTheme = '#FF99CC'; }
    if ( theme == '#EB5F00' ) { secondaryTheme = '#FFCC99'; }
    if ( theme == '#003366' ) { secondaryTheme = '#6699CC'; }
    if ( theme == '#336633' ) { secondaryTheme = '#99CC99'; }
    if ( theme == '#336666' ) { secondaryTheme = '#99CCCC'; }
    if ( theme == '#4FAF00' ) { secondaryTheme = '#CCCC66'; }
    if ( theme == '#000000' ) { secondaryTheme = '#FFFF99'; }
    
    var css = '<style type="text/css">\n' + 
	'body {font-size:12px}'+
    'div#head, body ul#nav_level1 li.on a, body ul#nav_level1 li.in a, body div#container .themebg {\n' +
	'    background-color: ' + theme + ';}\n' +
    'body ul#nav_level1, body ul#products li div#details_content, body div#container .themebrdr {\n' +
	'    border-color: ' + theme + ';}\n' +
    
	'body div#container .themeunder {\n' +
	'    color: ' + theme + '; border-color: ' + secondaryTheme + '}\n' +
    '</style>'
    document.write(css);
    return;
}


function hide_select () {
	if (!navigator.appName.indexOf("MSIE")) return;
	selects = document.getElementsByTagName('select'); 
	for(i = 0; i < selects.length; i++) { 
		if(selects[i].className!="dontHide"){ 
			selects[i].style.visibility = "hidden"; 
		} 
	} 
} 
function show_select () { 
	if (!navigator.appName.indexOf("MSIE")) return;
	selects = document.getElementsByTagName('select'); 
	for(i = 0; i < selects.length; i++) { 		
		selects[i].style.visibility = "visible"; 		
	} 
} 
function do_slide (obj) {
      
      if (click_ready == 0) {
            
            change_window_shade_header_color(obj);					
         
            if (g[obj] == 0) {      
                  obj += 1;           
                  for (var i = obj; i < 4; i++) {
                        if (g[i] == 0) {
                              if (i == 1) {
                                    slide2();
                              }
                              if (i == 2) {
                                    slide3();
                              }
                              if (i == 3) {
                                    slide4();
                              }
                        }
                  }
            }
            else if (g[obj] == 1) {
                  
                  for (var i = obj; i > 0; i--) {
                        if (g[i] == 1) {
                        if (i == 1) {
                              slide2();
                        }
                        if (i == 2) {
                              slide3();
                        }
                        if (i == 3) {
                              slide4();
                        }
                        }
                  }     
            }
            
      }
}
var slideAmountVal = 151;
var slideAmountOffset = 4;
function slide2(){
      
      click_ready = 1;
      
      if(obj_top_array[1] > (41 + slideAmountVal) && (g[1]==0)) {
            g[1] = 1;
            click_ready = 0;
            return;
      }
      if(obj_top_array[1] < (41 + slideAmountOffset) && (g[1]==1)){
            g[1] = 0;
            click_ready = 0;
            return;
      }
      
      if(g[1]==1) q_array[1] = -9;
      if(g[1]==0) q_array[1] = 9;
      
      obj_top_array[1] = obj_top_array[1] + q_array[1];
      
      e_array[1] = document.getElementById("window_shade2");
      e_array[1].style.top = obj_top_array[1] + 'px';
      
      t_array[1] = setTimeout("slide2();",0);
}
function slide3(){
      
      click_ready = 1;
      
      if(obj_top_array[2] > (66 + slideAmountVal) && (g[2]==0)) {
            g[2] = 1;
            click_ready = 0;
            return;
      }
      if(obj_top_array[2] < (66 + slideAmountOffset) && (g[2]==1)){
            g[2] = 0;
            click_ready = 0;
            return;
      }
      
      if(g[2]==1) q_array[2] = -9;
      if(g[2]==0) q_array[2] = 9;
      
      obj_top_array[2] = obj_top_array[2] + q_array[2];
      
      e_array[2] = document.getElementById("window_shade3");
      e_array[2].style.top = obj_top_array[2] + 'px';
      
      t_array[2] = setTimeout("slide3();",0);
}
function slide4(){
      
      click_ready = 1;
      
      if(obj_top_array[3] > (91 + slideAmountVal) && (g[3]==0)) {
            g[3] = 1;
            click_ready = 0;
            return;
      }
      if(obj_top_array[3] < (91 + slideAmountOffset) && (g[3]==1)){
            g[3] = 0;
            click_ready = 0;
            return;
      }
      
      if(g[3]==1) q_array[3] = -9;
      if(g[3]==0) q_array[3] = 9;
      
      obj_top_array[3] = obj_top_array[3] + q_array[3];
      
      e_array[3] = document.getElementById("window_shade4");
      e_array[3].style.top = obj_top_array[3] + 'px';
      
      t_array[3] = setTimeout("slide4();",0);
}




function switch_layer_index (layer) { 
	
	for(i=1;i<13;i++){
	if (i==layer) {
		document.getElementById("detail_hover"+i).style.zIndex = 20;
	} else {
		
		document.getElementById("detail_hover"+i).style.zIndex = 10;
		}
	}
	
	

	/*if (version >= 5.5) {
		if (document.getElementById("content_divider")) {
			document.getElementById("content_divider").style.zIndex = -1;
		}
		if (document.getElementById("content_links")) {
			document.getElementById("content_links").style.zIndex = -1;
		}
	}*/
}

function resize_tbox (parentId) {
	var max_height = 0;
	var version = 0;
	if (navigator.appVersion.indexOf("MSIE")!=-1) {
		temp = navigator.appVersion.split("MSIE");
		version = parseFloat(temp[1]);
	} 
	
	// =====================================================================================
	// for promos section
	//
	// Dynamically resize promos based on max height
	// =====================================================================================
	var parentEl = document.getElementById(parentId);
	var promos = new Array();
	var k=0;
	var foundPromos=false;
	nodes = parentEl.childNodes;	
	//find all tbox to resize, below this element	
	for(i=0;i<nodes.length;i++){
		var node = nodes[i];
		if(node.tagName==('DIV')&&node.id!='clearer'){
			promos[k++]=node;
			foundPromos=true;			
		}
	}	
	if(!foundPromos)return;
	//find max height
	for(i=0;i<promos.length;i++){
		var promo = promos[i];		
		if (promo.offsetHeight > max_height) {
			max_height = promo.offsetHeight;
		}
	}
	
	var correction = 0;
	if (version >= 5.5) {	
		for(i=0;i<promos.length;i++){	
			if(promos[i].className.indexOf('underline')!=-1)correction = 3;
			else correction = 0;
			promos[i].style.height = (max_height - correction) + 'px';
		}		
	}
	else {
		for(i=0;i<promos.length;i++){	
			if(promos[i].className.indexOf('underline')!=-1)correction = 3;
			else correction = 0;
			promos[i].style.height = (max_height - correction) + 'px';
		}	
	}
	if (version >= 7) {
		for(i=0;i<promos.length;i++){		
			if(promos[i].className.indexOf('underline')!=-1)correction = 3;
			else correction = 0;			
			promos[i].style.height = (max_height - correction) + 'px';
		}	
	}			
}

function resize_products () {
	var max_product_elements = 0;
	var max_margin_left = 0;
		
	// =====================================================================================
	// for products section
	//
	// dynamically center the products
	// =====================================================================================
	
	for (var j = 1; j < 13; j++) {
		if (document.getElementById("detail_hover"+j)) {
			max_product_elements += 1;
		}
	}
	max_margin_left = (12 - max_product_elements) * 65;
	document.getElementById ("product_container").style.marginLeft = max_margin_left + 'px';
}

function init_windowshade_header_color () {
	// =====================================================================================
	// for windowshade section
	//
	// dynamically set color of windowshade
	// =====================================================================================	
	var obj_header = document.getElementById("header1");
	original_color = obj_header.style.backgroundColor;
	
	document.getElementById("header2").style.backgroundColor = '#333333';
	document.getElementById("header3").style.backgroundColor = '#333333';
	document.getElementById("header4").style.backgroundColor = '#333333';
	document.getElementById ("header1").style.backgroundColor = original_color;
	document.getElementById ("header1").style.color = '#ffffff';
	do_slide(0); 
}

function resize_vertical_navigation () {
	// =====================================================================================
	// for navigation section
	//
	// Dynamically resize vertical dropdown width in IE6
	// =====================================================================================
	var version = 0;
	if (navigator.appVersion.indexOf("MSIE")!=-1) {
		temp = navigator.appVersion.split("MSIE");
		version = parseFloat(temp[1]);
	} 
	
	if (version >= 5.5) {
		var max_navObject1_width = document.getElementById("nav_object1").offsetWidth;
		var max_navObject2_width = document.getElementById("nav_object2").offsetWidth;
		var max_navObject3_width = document.getElementById("nav_object3").offsetWidth;
		
		document.getElementById("verticalselect1").style.width = max_navObject1_width + 'px';
		document.getElementById("verticalselect2").style.width = max_navObject2_width + 'px';
		document.getElementById("verticalselect3").style.width = max_navObject3_width + 'px'; 
	}
}

function change_window_shade_header_color (active_window_shade) {

	for (var y = 0; y < 4; y++) {
		
		if (y == active_window_shade) {
			document.getElementById("header" + (y + 1)).style.backgroundColor = original_color;
			document.getElementById("header" + (y + 1)).style.color = '#ffffff';
		}
		else {
			if (document.getElementById("header" + (y + 1)).style.backgroundColor == original_color) {
				document.getElementById("header" + (y + 1)).style.backgroundColor = '#333333';
				document.getElementById("header" + (y + 1)).style.color = '#ffffff';
			}
		}
	}
}
function SwitchMenu(active_item){
	if(document.getElementById){
	var el = document.getElementById(active_item);
	var ar = document.getElementById("masterdiv").getElementsByTagName("div"); 
		if(el.style.display != "block"){ 
			for (var i=0; i<ar.length; i++){
				if (ar[i].className=="submenu") {
					ar[i].style.display = "none";
				}
			}
			el.style.display = "block";
		}else{
			el.style.display = "none";
		}
	}
}

/**
* common library of javascript functions
*/
function addEvent(obj, evType, fn) {
    if (obj.addEventListener) {
		obj.addEventListener(evType, fn, true);
		return true;
    } else if (obj.attachEvent)  {
        var r = obj.attachEvent("on" + evType, fn);
        return r;
    } else {
        return false;
    }
}


/*
* fix alpha pngs on a page (turn on transparency for IE)
*/

function fixAlphaPng() {
    var src     = '';
    var ua      = '';
    var width   = '';
    var height  = '';
    var rpng    = new RegExp('\.(png)$');
    var rmsie   = new RegExp('msie');
    var rmac    = new RegExp('mac');

    for (var i = 0; i < document.getElementsByTagName('IMG').length; i++) {
        src     = document.getElementsByTagName('IMG')[i].getAttribute('src');
        ua      = navigator.userAgent.toLowerCase();
        width   = document.getElementsByTagName('IMG')[i].getAttribute('width');
        height  = document.getElementsByTagName('IMG')[i].getAttribute('height');

        if (src.match(rpng) && ua.match(rmsie) && !ua.match(rmac)) {
        	// document.getElementsByTagName('IMG')[i].setAttribute('src', 'images/spacer.gif');
			document.getElementsByTagName('IMG')[i].setAttribute('src', '/gap/img/spacer.gif');
            document.getElementsByTagName('IMG')[i].style.filter = 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'' + src + '\', sizingMethod=scale)';
           	document.getElementsByTagName('IMG')[i].style.width = width + 'px';
            document.getElementsByTagName('IMG')[i].style.height = height + 'px';            
        }
    }
}

/*
Nav Fix for IE hover
*/
navArray = Array('nav', 'products', 'industrySelector', 'countryLanguageSelector','verticalselect1','verticalselect2','verticalselect3', 'nav_main');
startList = function() {
	if (document.all&&document.getElementById) {
	
		//Top Navs
		for (m=0; m<navArray.length; m++) {
			if (document.getElementById(navArray[m])) {
			    //alert(navArray[m]);
				topNavRoot = document.getElementById(navArray[m]);
				//alert(topNavRoot.id);
				for (i=0; i<topNavRoot.childNodes.length; i++) {
					node = topNavRoot.childNodes[i];
					//alert(node.nodeName);
					if (node.nodeName=="LI") {
						//Sub UL
						for (j=0; j<node.childNodes.length; j++) {
							subTopNavRoot = node.childNodes[j];
							if (subTopNavRoot.nodeName=="UL") {
								first = 1
								for (k=0; k<subTopNavRoot.childNodes.length; k++) {
									subnode = subTopNavRoot.childNodes[k];
									if (subnode.nodeName=="LI") {
										if (first == 1) {
											subnode.className="first "+subnode.className;
											first = 0;
										}
										subnode.onmouseover=function() {
											this.className="over "+this.className;
										}
										subnode.onmouseout=function() {
											this.className=this.className.replace("over ", "");
										}
									}
								}
							}
						}
						node.onmouseover=function() {
							//alert(" m = "+m+"\n i = "+i+"\n j = "+j+"\n k = "+k);
							this.className="over "+this.className;							
							hide_select();
						}
						node.onmouseout=function() {
							this.className=this.className.replace("over ", "");							
							show_select();
						}
					}
				}
			}
		}
	}
}
addEvent(window, 'load', startList);



/*
Redirect to no cookies page
*/
function noCookies(redirect) {
	var tmpcookie = new Date();
	chkcookie = (tmpcookie.getTime() + '');
	document.cookie = "chkcookie=" + chkcookie + "; path=/";
	if (document.cookie.indexOf(chkcookie,0) < 0) {
		window.location = redirect;
	} else {
		return("true");
	}
}

/*
Clear default value of text input
*/
function clearField(thefield) {
	if (thefield.defaultValue==thefield.value)
	thefield.value = ""
}


/*
pop up new scrollable, resizable window
*/
function popup(url,w,h) {
	if (!w) {w='270';}
	if (!h) {h='270';}
	newPopup = window.open (url, 'hpgappop', 'resizable,scrollbars,width='+w+',height='+h);
	newPopup.focus();
}

/*
pop up new resizable, non-scrollable window with menu and toolbars 
(for navigatbale & printable pages.)
*/
function formpop(url,w,h) {
	newFormpop = window.open (url, 'wexnerform', 'resizable,menubar,toolbar,width='+w+',height='+h);
	newFormpop.focus();
}

function isEmptyString(s) {
    return (s == null || /^ *$/.test(s));
  }
  

setTheme();

function updateVerticalId(value){
  document.cookie= "verticalId="+escape(value)+";expires=Thu, 10 Dec 2078 16:10:11; path=/;domain = .hp.com ";
}

/*
swfobject
*/
if(typeof deconcept=="undefined"){var deconcept=new Object();}if(typeof deconcept.util=="undefined"){deconcept.util=new Object();}if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object();}deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a){if(!document.getElementById){return;}this.DETECT_KEY=_a?_a:"detectflash";this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params=new Object();this.variables=new Object();this.attributes=new Array();if(_1){this.setAttribute("swf",_1);}if(id){this.setAttribute("id",id);}if(w){this.setAttribute("width",w);}if(h){this.setAttribute("height",h);}if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));}this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(!window.opera&&document.all&&this.installedVer.major>7){deconcept.SWFObject.doPrepUnload=true;}if(c){this.addParam("bgcolor",c);}var q=_7?_7:"high";this.addParam("quality",q);this.setAttribute("useExpressInstall",false);this.setAttribute("doExpressInstall",false);var _c=(_8)?_8:window.location;this.setAttribute("xiRedirectUrl",_c);this.setAttribute("redirectUrl","");if(_9){this.setAttribute("redirectUrl",_9);}};deconcept.SWFObject.prototype={useExpressInstall:function(_d){this.xiSWFPath=!_d?"expressinstall.swf":_d;this.setAttribute("useExpressInstall",true);},setAttribute:function(_e,_f){this.attributes[_e]=_f;},getAttribute:function(_10){return this.attributes[_10];},addParam:function(_11,_12){this.params[_11]=_12;},getParams:function(){return this.params;},addVariable:function(_13,_14){this.variables[_13]=_14;},getVariable:function(_15){return this.variables[_15];},getVariables:function(){return this.variables;},getVariablePairs:function(){var _16=new Array();var key;var _18=this.getVariables();for(key in _18){_16[_16.length]=key+"="+_18[key];}return _16;},getSWFHTML:function(){var _19="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");this.setAttribute("swf",this.xiSWFPath);}_19="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\"";_19+=" id=\""+this.getAttribute("id")+"\" name=\""+this.getAttribute("id")+"\" ";var _1a=this.getParams();for(var key in _1a){_19+=[key]+"=\""+_1a[key]+"\" ";}var _1c=this.getVariablePairs().join("&");if(_1c.length>0){_19+="flashvars=\""+_1c+"\"";}_19+="/>";}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");this.setAttribute("swf",this.xiSWFPath);}_19="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\">";_19+="<param name=\"movie\" value=\""+this.getAttribute("swf")+"\" />";var _1d=this.getParams();for(var key in _1d){_19+="<param name=\""+key+"\" value=\""+_1d[key]+"\" />";}var _1f=this.getVariablePairs().join("&");if(_1f.length>0){_19+="<param name=\"flashvars\" value=\""+_1f+"\" />";}_19+="</object>";}return _19;},write:function(_20){if(this.getAttribute("useExpressInstall")){var _21=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){this.setAttribute("doExpressInstall",true);this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title);}}if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){var n=(typeof _20=="string")?document.getElementById(_20):_20;n.innerHTML=this.getSWFHTML();return true;}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}return false;}};deconcept.SWFObjectUtil.getPlayerVersion=function(){var _23=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var x=navigator.plugins["Shockwave Flash"];if(x&&x.description){_23=new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}}else{if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){var axo=1;var _26=3;while(axo){try{_26++;axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+_26);_23=new deconcept.PlayerVersion([_26,0,0]);}catch(e){axo=null;}}}else{try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}catch(e){try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");_23=new deconcept.PlayerVersion([6,0,21]);axo.AllowScriptAccess="always";}catch(e){if(_23.major==6){return _23;}}try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}catch(e){}}if(axo!=null){_23=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}}}return _23;};deconcept.PlayerVersion=function(_29){this.major=_29[0]!=null?parseInt(_29[0]):0;this.minor=_29[1]!=null?parseInt(_29[1]):0;this.rev=_29[2]!=null?parseInt(_29[2]):0;};deconcept.PlayerVersion.prototype.versionIsValid=function(fv){if(this.major<fv.major){return false;}if(this.major>fv.major){return true;}if(this.minor<fv.minor){return false;}if(this.minor>fv.minor){return true;}if(this.rev<fv.rev){return false;}return true;};deconcept.util={getRequestParameter:function(_2b){var q=document.location.search||document.location.hash;if(_2b==null){return q;}if(q){var _2d=q.substring(1).split("&");for(var i=0;i<_2d.length;i++){if(_2d[i].substring(0,_2d[i].indexOf("="))==_2b){return _2d[i].substring((_2d[i].indexOf("=")+1));}}}return "";}};deconcept.SWFObjectUtil.cleanupSWFs=function(){var _2f=document.getElementsByTagName("OBJECT");for(var i=_2f.length-1;i>=0;i--){_2f[i].style.display="none";for(var x in _2f[i]){if(typeof _2f[i][x]=="function"){_2f[i][x]=function(){};}}}};if(deconcept.SWFObject.doPrepUnload){if(!deconcept.unloadSet){deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs);};window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload);deconcept.unloadSet=true;}}if(!document.getElementById&&document.all){document.getElementById=function(id){return document.all[id];};}var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject;

/************************************
* the following was added by Andrea Hill to support the T&C overlay in the image bank
********************************/
//create a global object to store the appropriate pdf to download
	var downloadObject = "";
  var highDefPic = "";

 function checkTC(el, aHighDefPic) {
  
	var grandparent = el.parentNode.parentNode.parentNode.parentNode;
	var sampleVal = grandparent.getElementsByTagName("input");
	//assuming the first (only?) input references the sample number)
	//assign value to global element
	downloadObject = sampleVal[0].getAttribute("value");
 
 	var sampleList = document.getElementById("samples");
	var fadedBg = document.getElementById("bg");
	var termsObj = document.getElementById("tandc");

	//display modal-like terms and conditions
	fadedBg.style.display = "block";
	termsObj.style.display = "block";
  highDefPic = aHighDefPic;
	return false;
 }
 
//called when "Submit" is clicked on terms and conditions to ensure the individual has agreed. 
function validateTandC() 
{	
	var rads = document.termsForm.acceptterms;
		if (document.getElementById("acceptyes").checked) {
			downloadPDF();
		}
		
		//hide conditions page either way
		hideTC();
}
 
 //placeholder function (validates access to global object)
 function downloadPDF() 
 {
	//alert("Now downloading sample " + downloadObject);
  window.open(highDefPic);
	return;
 }
 
 
 function hideTC() 
{
	var fadedBg = document.getElementById("bg");
	var termsObj = document.getElementById("tandc");
	
 	fadedBg.style.display = "none";
	termsObj.style.display = "none";

	return;
}