var goodLocales =['de','en','es','fr','cs_CZ','da_DK','de_DE','de_AT','de_CH','el_GR','en_AU','en_BH','en_JO','en_KW','en_LB','en_SA','en_OM','en_QA','en_SY','en_AE','en_YE','en_CA','en_DK','en_EG','en_IN','en_MY','en_NZ','en_PH','en_SG','en_GB','en_US','en_ZA','es_AR','es_CL','es_CR','es_EC','es_SV','es_ES','es_GT','es_HN','es_MX','es_NI','es_PA','es_PE','es_VE','es_CO','es_UY','fi_FI','fr_BE','fr_CA','fr_FR','fr_CH','hu_HU','it_IT','ja_JP','ko_KR','nl_BE','nl_NL','en_NO','pl_PL','pt_BR','pt-br_BR','pt_PT','ru_RU','sv_SE','th_TH','tr_TR','zh-cn_CN','zh-tw_HK','zh-tw_TW'];

//var GCGLocales=['pt_AR', 'pt_ES','he_IL','en_UK','es_RU','en_IL','zh_CN','zh_HK','zh_TW','zh_TR']
function addLocales(a){
	var temp = goodLocales.length;
	for(i in a){
		goodLocales[temp] = a[i];
		temp++;
	}
}
if(!tn_context1){var tn_context1=null;}
if(!tn_context2){var tn_context2=null;}
if(!pq_locale){var pq_locale=null;}
if(!tn_color){var tn_color='default';}
if(!tn_buImg){var tn_buImg=null;}
if(!tn_host){var tn_host=null;}

var a_ddItems=null;
var tn1=null;
var tn2=null;

function _dr(a){return document.write(a)}
function _g(tgt){return document.getElementById(tgt);}

var _lhn = location.hostname;
if(tn_host!=null){var _lh = tn_host}else{var _lh = location.host;}
var _pt = location.protocol;

var kex=/(kodak.com){1}/gi;
var wex=/(www){1}/gi;
var gex=/(graphics){1}|(search){1}|(cameras){1}/gi;
if(!dom_pre){var dom_pre = 'http://'+_lh;}
if(_lh.search(kex)!=-1&&_lh.search(wex)==-1){
	if(_lh.search(gex)!=-1){
		var dom_ret=dom_sret='http://www.kodak.com';	
	}else{
		var dom_sret='http://'+_lh;
		var dom_ret='';
	}
}else{
var dom_sret='http://www.kodak.com';
var dom_ret=_pt+'//www.kodak.com';		
}

function dom_check(a,b){
	checkEx = /(http){1}|(javascript){1}/gi;
	if(a.search(checkEx)!=-1){
		return '';
	}else if(b==1&&tn_context1==5){
		return dom_pre;
	}else{
		return dom_sret;
	}
}
var try_counter=0;
function checkForVar(v,f,i,b){
	if(eval(v+'==null')){
	var tt_temp = setTimeout('checkForVar(\''+v+'\',\''+f+'\',\''+i+'\',\''+b+'\')',i);
	try_counter++;
	if(try_counter>1000){
		clearTimeout(tt_temp);
		try_counter=0;
		if(b){eval(b)}
	}
	}else{
	eval(f);
	}
}

function loadCSS(tgt){
if(!head){var head=document.getElementsByTagName('head')[0];}
var css = document.createElement('link');
css.href=tgt;
css.rel='stylesheet';
css.type='text/css';
head.appendChild(css);
}
function loadScripts(tgt,name){
	var head=document.getElementsByTagName('head')[0];
	var script = document.createElement('script');
	script.src = tgt;
		if(tgt.match(/\.vbs*/gi)!=null){
		script.type = 'text/vbscript';
		}else{
		script.type = 'text/javascript';
		}
	head.appendChild(script);
}

function spinLocales(a){
	for(i in goodLocales){
		if(goodLocales[i]==a){
			return a;
			break;
		}
		if(i==goodLocales.length-1){
		return false;	
		}
	}
}

function checkLocale(a){
	//if(tn_context1==5){addLocales(GCGLocales)}
	if(spinLocales(a)!=false){
	var pq_locale=a;
	}else if(spinLocales(a.split('_')[0])!=false){
	var pq_locale=a.split('_')[0];
	}else{
	var pq_locale='en';
	}
	return pq_locale;
}

function addEvent(obj, evType, fn){ 
	if (obj.addEventListener){ 
		obj.addEventListener(evType, fn, false); 
		return true; 
	}else if (obj.attachEvent){ 
		var r = obj.attachEvent("on"+evType, fn); 
		return r; 
	}else { 
		return false; 
	} 
}

function openPopup (urlToPopup, height, width, name, bars){
if(!name||name=="") name = 'pnPopup';
if(!bars||bars=="") bars = 'yes';
var x = (screen.availWidth - width) / 2;
var y = (screen.availHeight - height) / 2;
var popup = window.open(urlToPopup, name,"scrollbars="+bars+", toolbar=yes, resizable=yes, width="+width+", height="+height+", left="+x+", top="+y+" screenX="+x+", screenY="+y);
popup.resizeTo(width,height);
popup.focus();
}
	var regEx = /[\/ ]* [&amp;]*/g
	var regExSect = /[& ]* [&amp;]*/g
	
function setLink(tgt, url, sect, beacon){
	if(!beacon){
		beacon = tgt.innerHTML.replace(regEx,"");
	}else{
		beacon = beacon.replace(regEx,"");
	}
	if(sect){
	sect = sect.replace(regExSect,"")
	var track ='//'+sect+'//'+beacon
	}else{track=beacon}
	_hbLink(track)
	if(!tgt.href&&url!=''){
		location.href=url;
		//alert(track+' | '+url)
	}
}
function setReturnURI(id,lt){
var ret = location.pathname;
ret+='?pq-path='+pq_path+'&pq-locale='+pq_locale;
return document.write('<a href="/eknec/PageQuerier.jhtml?pq-path='+id+'&successURI='+ret+'">'+lt+'</a>');
}
var quit;
function hdr_show(tgt){
if(!window.current==false){
kill();
hide(window.current);
}
window.current = tgt;
document.getElementById(tgt).style.visibility='visible'
}
function show(tgt){
if(!window.current==false){
kill();
hide(window.current);
}
window.current = tgt;
document.getElementById(tgt).style.visibility='visible'
}
function hide(tgt){
document.getElementById(tgt).style.visibility='hidden'
}
function wait(tgt, time){
if(!time){var time = 1500;}
window.quit = window.setTimeout('hide(\''+tgt+'\')',time);  //hide(document.getElementById(tgt))
}
function kill(){
if(quit)clearTimeout(quit);
}
function change(tgt){
i=tgt.style
i.color='#CC0000';
i.textDecoration='underline';
}
function changeBack(tgt){
i=tgt.style
i.color='#0066CC';
i.textDecoration='none';
}
var imgRoot = '/global/images/mul/corp/companyHomePage/WoW/';
function change_img(tgt){
i = tgt.getElementsByTagName('img')[0];
i.src=imgRoot+'flyOut/'+i.id+'_over.gif'
}
function changeBack_img(tgt){
i = tgt.getElementsByTagName('img')[0];
i.src=imgRoot+'flyOut/'+i.id+'.gif'
};