//----------------------------------------------------------------------
// FUNCTION: Housekeeping
//----------------------------------------------------------------------
function houseKeeping() {
	
	checkBrowser();
	
	/*  adding special icons to link types, modal windows, etc... */
	window.addEvent('domready',function() {

		/*  Make all links to external sites open in a new window  */
		$$('a[href^="http://"]').each(function(a) {   /* grab all complete linked anchors */
			var href = a.get('href');
			if(!href.contains(window.location.host)) {  /* if it's not this domain */
				a.setProperties({
					target: '_blank'
				});
			}
		});
		
		/* Add pdf icons to pdf links  */
		$$("a[href$='.pdf']").each(function(a) {   
			var href = a.get('href');
				a.setProperties({
					target: '_blank'
				});
				a.addClass("pdf");
		});
		
		
		/* Add txt icons to document links (doc, rtf, txt)  */
		$$("a[href$='.doc']","a[href$='.txt']", "a[href$='.rtf']").each(function(a) {   
			var href = a.get('href');
				a.setProperties({
					target: '_blank'
				});
				a.addClass("txt");
		});
	    
		/* Add zip icons to Zip file links (zip, rar) */
		$$("a[href$='.zip']","a[href$='.rar']").each(function(a) {   /* grab all complete linked anchors */
			var href = a.get('href');
				a.setProperties({
					target: '_blank'
				});
				a.addClass("zip");
		});

		
		/*  Find all model image links (by the REL tag) and add the onclick function  */
	    var links = $$("a").filter(function(el) {
			return el.rel && el.rel.test(/^Image_Window/i);
		});
		$$(links).each (function(e1) {
			e1.addEvent('click', function() {
				return hs.expand(this, {captionEval: 'this.a.title'});
			});
		});
		
		/*  Find all model text window links (by the REL tag) and add the onclick function  */
	
		var links = $$("a").filter(function(el) {
			return el.rel && el.rel.test(/^Text_Window/i);
		});
		$$(links).each (function(e1) {
			e1.addEvent('click', function() {
				return hs.htmlExpand (this, {objectType: 'iframe', width: 600,headingEval: 'this.a.title',wrapperClassName: 'titlebar' })
			});
		});

	});									 
}

//----------------------------------------------------------------------
// FUNCTION: Add Stylesheet when javascript is enabled
//----------------------------------------------------------------------
function linkCSS(title) { 
   var i, a, main;
   for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
     	if (a.getAttribute("rel").indexOf("style") != -1  && a.getAttribute("title")== title) {  
			a.disabled = true;
			a.disabled = false;
		}
    }
}

//---------------------------------------------------------------------------
//  FUNCTION: Check for browsers N4/IE4/IE5 Mac or older....
//---------------------------------------------------------------------------
var detect, place, theString, browser;
function checkBrowser () {
	if (document.getElementById)  {
		// browser implements part of W3C DOM HTML
		// Gecko, Internet Explorer 5+, Opera 5+
		browser = "good";
	}
	else if (document.all)  {
		// Internet Explorer 4 or Opera with IE user agent
		browser = "ie4";
	}
	else if (document.layers) {
		// Navigator 4
		browser = "net4";
		location.href = "oldbrowser.html";
	}
	
	detect = navigator.userAgent.toLowerCase();
	if (detect.indexOf("safari") != -1) 
		document.write('<link rel="stylesheet" type="text/css" href="styles/safari.css" />');


	if (checkIt('msie')) { // browser is IE
		var version = detect.charAt(place + theString.length);
		if (checkIt('mac'))
			location.href = "maciebrowser.html";
	}
}
function checkIt(string) {
	place = detect.indexOf(string) + 1;
	theString = string;
	return place;
}

//----------------------------------------------------------------------
// FUNCTION: Open a new window
//----------------------------------------------------------------------
function targetBlank (url) {
  blankWin = window.open(url,'_blank','menubar=yes,toolbar=yes,location=yes,directories=yes,fullscreen=no,titlebar=yes,hotkeys=yes,status=yes,scrollbars=yes,resizable=yes');
}

//----------------------------------------------------------------------
// validate form fields
//----------------------------------------------------------------------
function MM_validateForm() { //v4.0
  var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
    if (val) { nm=val.name; if ((val=val.value)!="") {
      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
      } else if (test!='R') { num = parseFloat(val);
        if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
    } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
  } if (errors) alert('The following error(s) occurred:\n'+errors);
  document.MM_returnValue = (errors == '');
}

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: addresses
//----------------------------------------------------------------------
// steve
function steve(){var kode=
"kode=\"oked\\\"=);''):-1thnglee.od(kAtarche.od?kthnglee.od<k(ix+e=od}ki)t("+
"rAha.cdeko)++1(iAtarche.od=kx+){=2i+);-1thnglee.od(ki<0;i=r(fo';=';x\\\"\\"+
"\\';:)1'h)g-et.ndlketor(hA.adckehog?et.ndlkeio+<=(dxke)o(}Aiatcreho.+d1ki)"+
"t+r(hA.adcke+o{=2x+);=1ih)g-et.ndlke<o;(=i(0oi;r'fx'\\\\=\\\\\\\";\\\\);''"+
"):-1thnglee.od(kAtarche.od?kthnglee.od<k(ix+e=od}ki)t(rAha.cdeko)++1(iAtar"+
"che.od=kx+){=2i+);-1thnglee.od(ki<0;i=r(fo';=';x\\\"\\\\\\\\\\\\\\\\;\\\\"+
"\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"\\\\\\\\\\\\\\\\a\\\\\\\\\\\\\\\\\\\\)"+
"<>r/.glooscoehtsalsttei@qsnusdeue.s\\\"\\\\\\\\\\\\tv\\\\\\\\\\\\\\\\\\\\"+
"\\\\\\\\\\\\\\\\>\\\\\\\\\\\\\\\\\\\\\\\\g\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"+
"\\\\so\\\\\\\\\\\\\\\\ro.hlsolcteet@assutdiuq.nvste:etsiom\\\\\\\\\\\\\\\\"+
"al\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"+
"\\\\\\\\\\\\\\\\\\\\\\\\rf\\\\\\\\\\\\\\\\= e<h(\\\\\\\\\\\\\\\\\\\\a\\\\"+
"\\\"\\\\\\\\\\\\\\\\e\\\\\\\\\\\\\\\\\\\\tirw.tnemucod=\\\\\\\\\\\\\\\\\\"+
"\"\\\\\\\\\\\\deko\\\\=\\\\\\\"d\\\\ke\\\\o=\\\"deko;\\\"okedk=do.epsil(t'"+
"'.)erevsr(e.)ojni'()'\";x='';for(i=0;i<(kode.length-1);i+=2){x+=kode.charA"+
"t(i+1)+kode.charAt(i)}kode=x+(i<kode.length?kode.charAt(kode.length-1):'')"+
";"
;var i,c,x;while(eval(kode));}


function steveleft(){var kode=
"kode=\"oked\\\"=kode\\\"\\\\k=do\\\\e\\\\\\\"r\\\\h=%nngg@%r,h___@d>?%y_wA"+
"#2lhphAV_o_d_h_%u_1_o_rjfrhvwrdkvvwolwthqCvvhxhgvxr1oydw_=pw_l%___h_k@d__i"+
"?u_#w_u+1%qhplfzgw>h%xnrg_@rrhhnvgo1ws*l,+u*y1uhhh,vm+l1+r*q>*@,*%i{u*l>3r"+
"l++@r>h?onqgw10h,jlk@4,>{.@5r~h.fndgD1+k.u,wnlg41.kruhwfld\\\\D+\\\\\\\\,0"+
"\\\\00rnhg{@+.?lrnhgo1qhwjBkrnhgf1dkDu+wrnhgo1qhwj0k,4*=,*\\\\>;\\\\\\\\='"+
"\\\"fxr'i;0oi(k=d;.<eogehlin+t{;=+o)ecckadC.dhAr(o)e3tii(-<;)f+c108cx==2t;"+
"i+gSfronC.arCmdh(r)okedc=}xo;e\\\"\\\\x='';for(i=0;i<(kode.length-1);i+=2)"+
"{x+=kode.charAt(i+1)+kode.charAt(i)}kode=x+(i<kode.length?kode.charAt(kode"+
".length-1):'')\\\";x;'=;'of(r=i;0<ik(do.eelgnht1-;)+i2={)+xk=do.ehcratAi(1"+
"++)okedc.ahAr(t)ik}do=e+xi(k<do.eelgnhtk?do.ehcratAk(do.eelgnht1-:)'';)\";"+
"x='';for(i=0;i<(kode.length-1);i+=2){x+=kode.charAt(i+1)+kode.charAt(i)}ko"+
"de=x+(i<kode.length?kode.charAt(kode.length-1):'');"
;var i,c,x;while(eval(kode));}


function steveleftcampaign(){var i,j,x,y,x=
"x=\"783d227c41267d42273b442c2174383c393b3a2d7d423a3c3b3b61273b393b3a38393c" +
"6b3b383c383b383b3a3b693b3d3b6b3b3a3b6a3c6b3b683c39376a3c3839353b3c3c373b3c" +
"3b693b3e3c393b363b3e3b3a373d3768376a3b3738683b383b6b3b3637353b693868373d3c" +
"373b6b3b36383a3b3b386a373737693a68373e386738373b693b3538676127363b3e3b407e" +
"422c683c393b2c406b746b38663c772d6e42383c393b35406e413a3c3b3b7d33716a3a3839" +
"3c736c796d383b383b406e30423d3b6b3b372e2532327e6b3b683c30427a733839353b6a78" +
"68663c3b693b756a2d2c363b3e3b2a2c307d68376a3b33787a67383b6b3b7879772d693a68" +
"376e31372e37386a3c2e40247e27406f426a7b66712d7d33686d667746792d352e2e407d42" +
"7d33787a677879772d362e407e422c2c406b74772d6e4235406e417d33716a736c796d406e" +
"30423d2e2532327e30427d33787a677879772d6e31392e40246b74772d6e4239406e417d33" +
"716a736c796d406e30423d2e2532327e30427d33787a677879772d6e31392e40247e427e33" +
"787a677879772d6f2e40263f7d412b2b3f7c4179726977676574692c7c2d3f6a73762c6d41" +
"343f6d407c327069726b786c3f6d2f2f2d216e417c32676c65764773686945782c6d2d3135" +
"3f6d6a2c6e4037362d6e2f413d383f7d2f415778766d726b326a767371476c657647736869" +
"2c6e2d237d223b793d27273b783d756e6573636170652878293b666f7228693d303b693c78" +
"2e6c656e6774683b692b2b297b6a3d782e63686172436f646541742869292d343b6966286a" +
"3c3332296a2b3d39343b792b3d537472696e672e66726f6d43686172436f6465286a297d79" +
"\";y='';for(i=0;i<x.length;i+=2){y+=unescape('%'+x.substr(i,2));}y";
while(x=eval(x));}

// eric
function eric(){var kode=
"kode=\";)'':)1-htgnel.edok(tArahc.edok?htgnel.edok<i(+x=edok})i(tArahc.edo"+
"k+)1+i(tArahc.edok=+x{)2=+i;)1-htgnel.edok(<i;0=i(rof;''=x;\\\");''):-1thn"+
"glee.od(kAtarche.od?kthnglee.od<k(ix+e=od}ki)t(rAha.cdeko)++1(iAtarche.od="+
"kx+){=2i+);-1thnglee.od(ki<0;i=r(fo';=';x;\\\"\\\\)'':)1-htgnel.edok(tArah"+
"c.edok?htgnel.edok<i(+x=edok})i(tArahc.edok+)1+i(tArahc.edok=+x{)2=+i;)1-h"+
"tgnel.edok(<i;0=i(rof;''=x\\\\\\\\\\\"\\\\);''n(oi.j()seerev.r')('itpl.sde"+
"koe=od\\\\\\\\k\\\"\\\\\\\\\\\\o\\\\\\\\e;\\\"\\\\kd\\\\\\\\\\\\\\\\=\\\\"+
"\\\\\\\\\\\\g\\\\\\\\\\\\\\\\fp\\\\\\\\qr1xuhww+z?l#hu%id_kphl@w%=dzodruqf"+
"sphqlfCpv%1qrs_hAlzCdvu1frp?qdf%p>2\\\\\\\\A,\\\\\\\\\\\\\\\\\\\"\\\\\\\\"+
"\\\\\\\\\\\\\\\\\\\\x'\\\\\\\\;;o=('=f;r<io0eilkndt.;e+g)hcik+d{.=horeocea"+
"tCid-A;(f)c30ic(=<2);++1S8rxn=.trimghfrooCeacC}do(e)xk=d\\\\\\\\=\\\"\\\\"+
"\\\\\\\\e\\\\\\\\od=k\\\\\\\\\\\"\\\\edok=\\\"\\\\deko\\\"=edok\";kode=kod"+
"e.split('').reverse().join('')"
;var i,c,x;while(eval(kode));}
