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 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\n'+errors);
  document.MM_returnValue = (errors == '');
}

/**
 * This script contains embed functions for common plugins. This scripts are complety free to use for any purpose.
 */

function writeFlash(p) {
	writeEmbed(
		'D27CDB6E-AE6D-11cf-96B8-444553540000',
		'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0',
		'application/x-shockwave-flash',
		p
	);
}

function writeShockWave(p) {
	writeEmbed(
	'166B1BCA-3F9C-11CF-8075-444553540000',
	'http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0',
	'application/x-director',
		p
	);
}

function writeQuickTime(p) {
	writeEmbed(
		'02BF25D5-8C17-4B23-BC80-D3488ABDDC6B',
		'http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0',
		'video/quicktime',
		p
	);
}

function writeRealMedia(p) {
	writeEmbed(
		'CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA',
		'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0',
		'audio/x-pn-realaudio-plugin',
		p
	);
}

function writeWindowsMedia(p) {
	p.url = p.src;
	writeEmbed(
		'6BF52A52-394A-11D3-B153-00C04F79FAA6',
		'http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701',
		'application/x-mplayer2',
		p
	);
}

function writeEmbed(cls, cb, mt, p) {
	var h = '', n;

	h += '<object classid="clsid:' + cls + '" codebase="' + cb + '"';
	h += typeof(p.id) != "undefined" ? 'id="' + p.id + '"' : '';
	h += typeof(p.name) != "undefined" ? 'name="' + p.name + '"' : '';
	h += typeof(p.width) != "undefined" ? 'width="' + p.width + '"' : '';
	h += typeof(p.height) != "undefined" ? 'height="' + p.height + '"' : '';
	h += typeof(p.align) != "undefined" ? 'align="' + p.align + '"' : '';
	h += '>';

	for (n in p)
		h += '<param name="' + n + '" value="' + p[n] + '">';

	h += '<embed type="' + mt + '"';

	for (n in p)
		h += n + '="' + p[n] + '" ';

	h += '></embed></object>';

	document.write(h);
}

(function(Sizzle){

var Expr=Sizzle.selectors;

Expr.attrPrefix = {};

Expr.match.ATTR = /\[\s*(\W*(?:[\w\u00c0-\uFFFF_-]|\.|\\.)+)\s*(?:(\S?[=<>])\s*(['"]*)(.*?)\3|)\s*\](?![^\[]*\])(?![^\(]*\))/;
//inserted:              \W*                      |\.                 [ <>]                         lookahead appended later

Expr.filter.ATTR = function(elem, match){
	
	var name = match[1],
		result,
		value,
		type = match[2],
		check = match[4],
		prefix = name.match(/(^\W+)(.*)/);
	
	if( prefix !== null ){
		for( var i in Expr.attrPrefix )
			if( i === prefix[1] ) {
				result = Expr.attrPrefix[i](elem, prefix[2]);
				break;
			}
	} else
		result = Expr.attrHandle[ name ] ?
			Expr.attrHandle[ name ]( elem ) :
			elem[ name ] != null ?
				elem[ name ] :
				elem.getAttribute( name );

	value = result + "";
	  
	var ret = result == null ?
		type === "!=" :
		type === "=" ?
		value === check :
		type === "*=" ?
		value.indexOf(check) >= 0 :
		type === "~=" ?
		(" " + value + " ").indexOf(check) >= 0 :
		!check ?
		result === 0 || result :
		type === "!=" ?
		value != check :
		type === "^=" ?
		value.indexOf(check) === 0 :
		type === "$=" ?
		value.substr(value.length - check.length) === check :
		type === "|=" ?
		value === check || value.substr(0, check.length + 1) === check + "-" :
		type === "/=" ?
		new RegExp(check).test(value) :
		false;
	
	if( ret || type && type.match(/<|>/) === null ) return ret;
	
	var newValue = parseFloat(value), newCheck = parseFloat(check);
	value = isNaN( newValue ) ? value : newValue;
	check = isNaN( newCheck ) ? check : newCheck;
	
	return type === "<" ? value < check :
		type === ">" ? value > check :
		type === "<=" ? value <= check :
		type === ">=" ? value >= check :
		false;
}

})( (jQuery && jQuery.find) || Sizzle);


(function($){
	//Sizzle.selectors.attrPrefix
	$.extend( $.expr.attrPrefix, {
		':': function(e, val){ return  $(e).data(val); },
		'~': function(e, val){ return  $.curCSS(e, val); },
		'&': function(e, val){ var d = $.data(e, 'events'); return d && d[val]; },
		'::': function(e, val){ var d = $.data(e, 'metadata'); return d && d[val]; }
	})

})(jQuery);



$(document).ready(function(){var a=navigator.userAgent.toLowerCase();$.browser.chrome=/chrome/.test(navigator.userAgent.toLowerCase());if($.browser.msie){$('body').addClass('browserIE');$('body').addClass('browserIE'+$.browser.version.substring(0,1))}if($.browser.chrome){$('body').addClass('browserChrome');a=a.substring(a.indexOf('chrome/')+7);a=a.substring(0,1);$('body').addClass('browserChrome'+a);$.browser.safari=false}if($.browser.safari){$('body').addClass('browserSafari');a=a.substring(a.indexOf('version/')+8);a=a.substring(0,1);$('body').addClass('browserSafari'+a)}if($.browser.mozilla){if(navigator.userAgent.toLowerCase().indexOf('firefox')!=-1){$('body').addClass('browserFirefox');a=a.substring(a.indexOf('firefox/')+8);a=a.substring(0,1);$('body').addClass('browserFirefox'+a)}else{$('body').addClass('browserMozilla')}}if($.browser.opera){$('body').addClass('browserOpera')}});


$(document).ready(function() {	
	
	$('#logo img').hover(function() {
		$(this).stop().fadeTo("slow", 0.01);
	}, function() {
		$(this).stop().fadeTo("slow", 1.00);
	});
	
	$('.menu li').hover(function() {
		$(this).find("> ul").hide().fadeIn("normal");
	}, function() {
	});	
	
	$('#content').css("opacity","0.84");
	
	$("#text img[~float=right]").css("marginLeft","20px");
	$("#text img[~float=left]").css("marginRight","20px");
	
});
