// developer: Let's create ML namespace; ML stands for current developing company
var ML;
!ML ? ML = {} : alert('ML object alredy exist :\(, please resolve namespace issue');

ML.toString = function() {
	return '[object ML]';
}

// developer: debug js function
ML.clog = function (mixed, prop, show) {
	var top_arguments = arguments.callee;
	// if browser don't support console.log - force to show information
	if( !(window.console && window.console.log) ) show = true;
	
	var is_obj_passed = (typeof mixed == 'object' && mixed !== null); // check if object passed
	var is_function_passed = (typeof mixed == 'function'); // check if object passed
	
	if( typeof prop == 'boolean' ) {
		show = prop;
		prop = false;
	}
	
	// show mode
	if( show ) {
		if( !top_arguments.logs ) {
			top_arguments.logs = [];
		}
		if( !top_arguments.removed_logs ) {
			top_arguments.removed_logs = [];
		}
		
		// need for add information to log div
		var addLog = function (string) {
			log_div.innerHTML += '<pre style="border-bottom:1px solid #000; padding:5px; margin:0 0 5px; height:auto !important;">'+string+"</pre>\n";
		}
		
		var log_div = document.createElement('div');
		var log_length = top_arguments.logs.length;
		addLog('<b>LOG ID: '+log_length+' (not a propertie!)</b>');
		top_arguments.logs[log_length] = log_div;
		
		log_div.style.cssText = 'border:1px solid #000; background:#fff; color:#000; font:12px/18px Arial; padding:10px; margin:10px 0; clear:both; position:relative; z-index:3999;';
		log_div.className = 'log log-'+log_length;
		document.body.appendChild(log_div);
	}
	
	var print = function(log) {
		if(show) {
			addLog(log);
		} else {
			console.log(log+'\n\n--------------------');
		}
	}
	
	// if object - log it's properties
	if(is_obj_passed || is_function_passed) {
		// if in FIND propertie mode
		if(prop) {
			// if searched propertie found - log it
			prop in mixed ? print(prop+': '+mixed[prop]) :
			// if searched propertie not found - notify
			print(prop+' wasn\'t found in '+(is_function_passed?'[PASSED FUNCTION]':mixed.toString()) )
		} else {// if in regular mode
			for(p in mixed) {
				print(p+': ['+typeof mixed[p]+(mixed[p] instanceof Array?' Array':'')+':] '+mixed[p]);
			}
			if(is_function_passed) print('[PASSED FUNCTION:] '+mixed);
			if(is_obj_passed) print('[PASSED '+(mixed instanceof Array?'ARRAY:] ':'OBJECT:] ')+mixed);
		}
	} else {// if passed param is not object
		print('['+typeof mixed+':] '+mixed);
	}
	
	var init = function(name, callback) {
		if(!(name in top_arguments)) {
			top_arguments[name] = callback;
		}
	}
	
	init('restore', function(id) {
		if(!id && typeof id != 'number') return false;
		
		for(p in this.removed_logs) {
			if (id == this.removed_logs[p]) {
				document.body.appendChild(this.logs[this.removed_logs.splice(p, 1)]);
				return true;
			}
		}
		return false;
	});

	init('remove', function(id) {
		if(!id && typeof id != 'number') return false;
		
		for(p in this.logs) {
			if (id == p) {
				try {
					document.body.removeChild(this.logs[p]);
					this.removed_logs[this.removed_logs.length] = id;
					return true;
				} catch(e) {
					return false;
				}
			}
		}
		return false;
	});
	
	init('clear', function () {
		if( !this.logs.length ) return false;
		
	    for (var i=0, il = this.logs.length; i < il; i++) {
		    this.remove(i);
	    };
	});

	init('cclear', function () {
		if(!window.console) this.clear();
		else { if('clear' in console) console.clear(); };
	});
}

//catch IE6-8
	ML.ie9 = ML.ie8 = ML.ie7 = ML.ie6 = false;
//catch IE6-8

// Check that Jquery html object(s) exist, return true is yes
// developer: usage $empty($('.some-css-selector')) or $empty([$('#a'), $('.b'), $('div.c')]) - will return true(empty) in case if even one element don't exist
	ML.$empty = function(element) {
		var fname = '\'$empty\'';
		if( !($ && $.prototype.jquery) ) throw fname+' function reqire jQuery';
		if(!element) throw 'object or array should be passed to '+fname+' function';
		if( !$.isArray(element) && !element.selector ) throw fname+' function reqire jQuery object with selector as an argument or array of Jquery objects';
		
		if( $.isArray(element) ) {
			for (var i=0, il = element.length; i < il; i++) {
				if( !$(element[i]).selector ) throw fname+' function reqire jQuery object with selector as an argument; there is no selector for '+i+' element in array';
				if( element[i].length === 0 ) {
					return true;
					break;
				}
			}
		}
		
		if(element.length !== 0) {
			return false;
		}
		return true;
	};
// Check that Jquery html object(s) exist End

// search classname in body and return true if exist
	ML.classInBody = function(classname) {
		var fname = '\'classInBody\'';
		if(typeof classname != 'string') throw fname+' reqire string as an argument';
		
		if( document.body.className.search(classname) !== -1 ) {return true;}
		return false;
	};
// search classname in body End

/*
* jquery-placeholder 1.1 - minimalistic jQuery plugin to add a placeholder text to a text field
* http://github.com/jgradim/jquery-placeholder/
* Copyright (c) 2009 João Gradim
* Licensed under the MIT license:
* http://www.opensource.org/licenses/mit-license.php
*/
(function(a){a.fn.placeholder=function(b){var c=a.extend({},a.fn.placeholder.defaults,b);return this.each(function(){var d=a(this);d.focus(function(){d.removeClass(c.cls);if(d.val()==c.text){d.val("")}}).blur(function(){if(d.val()==""){d.addClass(c.cls).val(c.text)}});d.blur();d.parents("form:first").submit(function(){if(c.clearOnSubmit&&d.val()==c.text){d.val("")}})})};a.fn.placeholder.defaults={text:"enter text",cls:"placeholder",clearOnSubmit:true}})(jQuery);

ML.init = function(fname) {
switch(fname) {
case 'DD_belatedPNG':
/**
* DD_belatedPNG: Adds IE6 support: PNG images for CSS background-image and HTML <IMG/>.
* Author: Drew Diller
* Email: drew.diller@gmail.com
* URL: http://www.dillerdesign.com/experiment/DD_belatedPNG/
* Version: 0.0.8a
* Licensed under the MIT License: http://dillerdesign.com/experiment/DD_belatedPNG/#license
*
* Example usage:
* DD_belatedPNG.fix('.png_bg'); // argument is a CSS selector
* DD_belatedPNG.fixPng( someNode ); // argument is an HTMLDomElement
* DD_belatedPNG.fixAspx('.png_bg'); // argument is a CSS selector, fix for .aspx extension
**/
if( !(fname in window) ) {
DD_belatedPNG={ns:"DD_belatedPNG",imgSize:{},delay:10,nodesFixed:0,createVmlNameSpace:function(){if(document.namespaces&&!document.namespaces[this.ns]){document.namespaces.add(this.ns,"urn:schemas-microsoft-com:vml")}},createVmlStyleSheet:function(){var b,a;b=document.createElement("style");b.setAttribute("media","screen");document.documentElement.firstChild.insertBefore(b,document.documentElement.firstChild.firstChild);if(b.styleSheet){b=b.styleSheet;b.addRule(this.ns+"\\:*","{behavior:url(#default#VML)}");b.addRule(this.ns+"\\:shape","position:absolute;");b.addRule("img."+this.ns+"_sizeFinder","behavior:none; border:none; position:absolute; z-index:-1; top:-10000px; visibility:hidden;");this.screenStyleSheet=b;a=document.createElement("style");a.setAttribute("media","print");document.documentElement.firstChild.insertBefore(a,document.documentElement.firstChild.firstChild);a=a.styleSheet;a.addRule(this.ns+"\\:*","{display: none !important;}");a.addRule("img."+this.ns+"_sizeFinder","{display: none !important;}")}},readPropertyChange:function(){var b,c,a;b=event.srcElement;if(!b.vmlInitiated){return}if(event.propertyName.search("background")!=-1||event.propertyName.search("border")!=-1){DD_belatedPNG.applyVML(b)}if(event.propertyName=="style.display"){c=(b.currentStyle.display=="none")?"none":"block";for(a in b.vml){if(b.vml.hasOwnProperty(a)){b.vml[a].shape.style.display=c}}}if(event.propertyName.search("filter")!=-1){DD_belatedPNG.vmlOpacity(b)}},vmlOpacity:function(b){if(b.currentStyle.filter.search("lpha")!=-1){var a=b.currentStyle.filter;a=parseInt(a.substring(a.lastIndexOf("=")+1,a.lastIndexOf(")")),10)/100;b.vml.color.shape.style.filter=b.currentStyle.filter;b.vml.image.fill.opacity=a}},handlePseudoHover:function(a){setTimeout(function(){DD_belatedPNG.applyVML(a)},1)},fix:function(a){if(this.screenStyleSheet){var c,b;c=a.split(",");for(b=0;b<c.length;b++){this.screenStyleSheet.addRule(c[b],"behavior:expression(DD_belatedPNG.fixPng(this))")}}},applyVML:function(a){a.runtimeStyle.cssText="";this.vmlFill(a);this.vmlOffsets(a);this.vmlOpacity(a);if(a.isImg){this.copyImageBorders(a)}},attachHandlers:function(i){var d,c,g,e,b,f;d=this;c={resize:"vmlOffsets",move:"vmlOffsets"};if(i.nodeName=="A"){e={mouseleave:"handlePseudoHover",mouseenter:"handlePseudoHover",focus:"handlePseudoHover",blur:"handlePseudoHover"};for(b in e){if(e.hasOwnProperty(b)){c[b]=e[b]}}}for(f in c){if(c.hasOwnProperty(f)){g=function(){d[c[f]](i)};i.attachEvent("on"+f,g)}}i.attachEvent("onpropertychange",this.readPropertyChange)},giveLayout:function(a){a.style.zoom=1;if(a.currentStyle.position=="static"){a.style.position="relative"}},copyImageBorders:function(b){var c,a;c={borderStyle:true,borderWidth:true,borderColor:true};for(a in c){if(c.hasOwnProperty(a)){b.vml.color.shape.style[a]=b.currentStyle[a]}}},vmlFill:function(e){if(!e.currentStyle){return}else{var d,f,g,b,a,c;d=e.currentStyle}for(b in e.vml){if(e.vml.hasOwnProperty(b)){e.vml[b].shape.style.zIndex=d.zIndex}}e.runtimeStyle.backgroundColor="";e.runtimeStyle.backgroundImage="";f=true;if(d.backgroundImage!="none"||e.isImg){if(!e.isImg){e.vmlBg=d.backgroundImage;e.vmlBg=e.vmlBg.substr(5,e.vmlBg.lastIndexOf('")')-5)}else{e.vmlBg=e.src}g=this;if(!g.imgSize[e.vmlBg]){a=document.createElement("img");g.imgSize[e.vmlBg]=a;a.className=g.ns+"_sizeFinder";a.runtimeStyle.cssText="behavior:none; position:absolute; left:-10000px; top:-10000px; border:none; margin:0; padding:0;";c=function(){this.width=this.offsetWidth;this.height=this.offsetHeight;g.vmlOffsets(e)};a.attachEvent("onload",c);a.src=e.vmlBg;a.removeAttribute("width");a.removeAttribute("height");document.body.insertBefore(a,document.body.firstChild)}e.vml.image.fill.src=e.vmlBg;f=false}e.vml.image.fill.on=!f;e.vml.image.fill.color="none";e.vml.color.shape.style.backgroundColor=d.backgroundColor;e.runtimeStyle.backgroundImage="none";e.runtimeStyle.backgroundColor="transparent"},vmlOffsets:function(d){var h,n,a,e,g,m,f,l,j,i,k;h=d.currentStyle;n={W:d.clientWidth+1,H:d.clientHeight+1,w:this.imgSize[d.vmlBg].width,h:this.imgSize[d.vmlBg].height,L:d.offsetLeft,T:d.offsetTop,bLW:d.clientLeft,bTW:d.clientTop};a=(n.L+n.bLW==1)?1:0;e=function(b,p,q,c,s,u){b.coordsize=c+","+s;b.coordorigin=u+","+u;b.path="m0,0l"+c+",0l"+c+","+s+"l0,"+s+" xe";b.style.width=c+"px";b.style.height=s+"px";b.style.left=p+"px";b.style.top=q+"px"};e(d.vml.color.shape,(n.L+(d.isImg?0:n.bLW)),(n.T+(d.isImg?0:n.bTW)),(n.W-1),(n.H-1),0);e(d.vml.image.shape,(n.L+n.bLW),(n.T+n.bTW),(n.W),(n.H),1);g={X:0,Y:0};if(d.isImg){g.X=parseInt(h.paddingLeft,10)+1;g.Y=parseInt(h.paddingTop,10)+1}else{for(j in g){if(g.hasOwnProperty(j)){this.figurePercentage(g,n,j,h["backgroundPosition"+j])}}}d.vml.image.fill.position=(g.X/n.W)+","+(g.Y/n.H);m=h.backgroundRepeat;f={T:1,R:n.W+a,B:n.H,L:1+a};l={X:{b1:"L",b2:"R",d:"W"},Y:{b1:"T",b2:"B",d:"H"}};if(m!="repeat"||d.isImg){i={T:(g.Y),R:(g.X+n.w),B:(g.Y+n.h),L:(g.X)};if(m.search("repeat-")!=-1){k=m.split("repeat-")[1].toUpperCase();i[l[k].b1]=1;i[l[k].b2]=n[l[k].d]}if(i.B>n.H){i.B=n.H}d.vml.image.shape.style.clip="rect("+i.T+"px "+(i.R+a)+"px "+i.B+"px "+(i.L+a)+"px)"}else{d.vml.image.shape.style.clip="rect("+f.T+"px "+f.R+"px "+f.B+"px "+f.L+"px)"}},figurePercentage:function(d,c,f,a){var b,e;e=true;b=(f=="X");switch(a){case"left":case"top":d[f]=0;break;case"center":d[f]=0.5;break;case"right":case"bottom":d[f]=1;break;default:if(a.search("%")!=-1){d[f]=parseInt(a,10)/100}else{e=false}}d[f]=Math.ceil(e?((c[b?"W":"H"]*d[f])-(c[b?"w":"h"]*d[f])):parseInt(a,10));if(d[f]%2===0){d[f]++}return d[f]},fixPng:function(c){c.style.behavior="none";var g,b,f,a,d;if(c.nodeName=="BODY"||c.nodeName=="TD"||c.nodeName=="TR"){return}c.isImg=false;if(c.nodeName=="IMG"){if(c.src.toLowerCase().search(/\.png$/)!=-1){c.isImg=true;c.style.visibility="hidden"}else{return}}else{if(c.currentStyle.backgroundImage.toLowerCase().search(".png")==-1){return}}g=DD_belatedPNG;c.vml={color:{},image:{}};b={shape:{},fill:{}};for(a in c.vml){if(c.vml.hasOwnProperty(a)){for(d in b){if(b.hasOwnProperty(d)){f=g.ns+":"+d;c.vml[a][d]=document.createElement(f)}}c.vml[a].shape.stroked=false;c.vml[a].shape.appendChild(c.vml[a].fill);c.parentNode.insertBefore(c.vml[a].shape,c)}}c.vml.image.shape.fillcolor="none";c.vml.image.fill.type="tile";c.vml.color.fill.on=false;g.attachHandlers(c);g.giveLayout(c);g.giveLayout(c.offsetParent);c.vmlInitiated=true;g.applyVML(c)},fixAspx:function(a){if(this.screenStyleSheet){var c,b;c=a.split(",");for(b=0;b<c.length;b++){this.screenStyleSheet.addRule(c[b],"behavior:expression(DD_belatedPNG.fixPngAspx(this))")}}},fixPngAspx:function(c){c.style.behavior="none";var g,b,f,a,d;if(c.nodeName=="BODY"||c.nodeName=="TD"||c.nodeName=="TR"){return}c.isImg=false;if(c.nodeName=="IMG"){if(c.src.toLowerCase().search(/\.aspx$/)!=-1){c.isImg=true;c.style.visibility="hidden"}else{return}}else{if(c.currentStyle.backgroundImage.toLowerCase().search(".aspx")==-1){return}}g=DD_belatedPNG;c.vml={color:{},image:{}};b={shape:{},fill:{}};for(a in c.vml){if(c.vml.hasOwnProperty(a)){for(d in b){if(b.hasOwnProperty(d)){f=g.ns+":"+d;c.vml[a][d]=document.createElement(f)}}c.vml[a].shape.stroked=false;c.vml[a].shape.appendChild(c.vml[a].fill);c.parentNode.insertBefore(c.vml[a].shape,c)}}c.vml.image.shape.fillcolor="none";c.vml.image.fill.type="tile";c.vml.color.fill.on=false;g.attachHandlers(c);g.giveLayout(c);g.giveLayout(c.offsetParent);c.vmlInitiated=true;g.applyVML(c)}};try{document.execCommand("BackgroundImageCache",false,true)}catch(r){}DD_belatedPNG.createVmlNameSpace();DD_belatedPNG.createVmlStyleSheet();

///
// DD_belatedPNG End
///
} else {
	throw fname+' already initialized';
}
break;

case 'DD_roundies':
if( !(fname in window) ) {
/**
* DD_roundies, this adds rounded-corner CSS in standard browsers and VML sublayers in IE that accomplish a similar appearance when comparing said browsers.
* Author: Drew Diller
* Email: drew.diller@gmail.com
* URL: http://www.dillerdesign.com/experiment/DD_roundies/
* Version: 0.0.2a -  preview 2008.12.26
* Licensed under the MIT License: http://dillerdesign.com/experiment/DD_roundies/#license
*
* Usage:
* DD_roundies.addRule('#doc .container', '10px 5px'); // selector and multiple radii
* DD_roundies.addRule('.box', 5, true); // selector, radius, and optional addition of border-radius code for standard browsers.
* 
* Just want the PNG fixing effect for IE6, and don't want to also use the DD_belatedPNG library?  Don't give any additional arguments after the CSS selector.
* DD_roundies.addRule('.your .example img');
**/
DD_roundies={ns:'DD_roundies',IE6:false,IE7:false,IE8:false,IEversion:function(){if(document.documentMode!=8&&document.namespaces&&!document.namespaces[this.ns]){this.IE6=true;this.IE7=true}else if(document.documentMode==8){this.IE8=true}},querySelector:document.querySelectorAll,selectorsToProcess:[],imgSize:{},createVmlNameSpace:function(){if(this.IE6||this.IE7){document.namespaces.add(this.ns,'urn:schemas-microsoft-com:vml')}if(this.IE8){document.writeln('<?import namespace="'+this.ns+'" implementation="#default#VML" ?>')}},createVmlStyleSheet:function(){var a=document.createElement('style');document.documentElement.firstChild.insertBefore(a,document.documentElement.firstChild.firstChild);if(a.styleSheet){try{var b=a.styleSheet;b.addRule(this.ns+'\\:*','{behavior:url(#default#VML)}');this.styleSheet=b}catch(err){}}else{this.styleSheet=a}},addRule:function(a,b,c){if(typeof b=='undefined'||b===null){b=0}if(b.constructor.toString().search('Array')==-1){b=b.toString().replace(/[^0-9 ]/g,'').split(' ')}for(var i=0;i<4;i++){b[i]=(!b[i]&&b[i]!==0)?b[Math.max((i-2),0)]:b[i]}if(this.styleSheet){if(this.styleSheet.addRule){var d=a.split(',');for(var i=0;i<d.length;i++){this.styleSheet.addRule(d[i],'behavior:expression(DD_roundies.roundify.call(this, ['+b.join(',')+']))')}}else if(c){var e=b.join('px ')+'px';this.styleSheet.appendChild(document.createTextNode(a+' {border-radius:'+e+'; -moz-border-radius:'+e+';}'));this.styleSheet.appendChild(document.createTextNode(a+' {-webkit-border-top-left-radius:'+b[0]+'px '+b[0]+'px; -webkit-border-top-right-radius:'+b[1]+'px '+b[1]+'px; -webkit-border-bottom-right-radius:'+b[2]+'px '+b[2]+'px; -webkit-border-bottom-left-radius:'+b[3]+'px '+b[3]+'px;}'))}}else if(this.IE8){this.selectorsToProcess.push({'selector':a,'radii':b})}},readPropertyChanges:function(a){switch(event.propertyName){case'style.border':case'style.borderWidth':case'style.padding':this.applyVML(a);break;case'style.borderColor':this.vmlStrokeColor(a);break;case'style.backgroundColor':case'style.backgroundPosition':case'style.backgroundRepeat':this.applyVML(a);break;case'style.display':a.vmlBox.style.display=(a.style.display=='none')?'none':'block';break;case'style.filter':this.vmlOpacity(a);break;case'style.zIndex':a.vmlBox.style.zIndex=a.style.zIndex;break}},applyVML:function(a){a.runtimeStyle.cssText='';this.vmlFill(a);this.vmlStrokeColor(a);this.vmlStrokeWeight(a);this.vmlOffsets(a);this.vmlPath(a);this.nixBorder(a);this.vmlOpacity(a)},vmlOpacity:function(a){if(a.currentStyle.filter.search('lpha')!=-1){var b=a.currentStyle.filter;b=parseInt(b.substring(b.lastIndexOf('=')+1,b.lastIndexOf(')')),10)/100;for(var v in a.vml){a.vml[v].filler.opacity=b}}},vmlFill:function(a){if(!a.currentStyle){return}else{var b=a.currentStyle}a.runtimeStyle.backgroundColor='';a.runtimeStyle.backgroundImage='';var c=(b.backgroundColor=='transparent');var d=true;if(b.backgroundImage!='none'||a.isImg){if(!a.isImg){a.vmlBg=b.backgroundImage;a.vmlBg=a.vmlBg.substr(5,a.vmlBg.lastIndexOf('")')-5)}else{a.vmlBg=a.src}var e=this;if(!e.imgSize[a.vmlBg]){var f=document.createElement('img');f.attachEvent('onload',function(){this.width=this.offsetWidth;this.height=this.offsetHeight;e.vmlOffsets(a)});f.className=e.ns+'_sizeFinder';f.runtimeStyle.cssText='behavior:none; position:absolute; top:-10000px; left:-10000px; border:none;';f.src=a.vmlBg;f.removeAttribute('width');f.removeAttribute('height');document.body.insertBefore(f,document.body.firstChild);e.imgSize[a.vmlBg]=f}a.vml.image.filler.src=a.vmlBg;d=false}a.vml.image.filled=!d;a.vml.image.fillcolor='none';a.vml.color.filled=!c;a.vml.color.fillcolor=b.backgroundColor;a.runtimeStyle.backgroundImage='none';a.runtimeStyle.backgroundColor='transparent'},vmlStrokeColor:function(a){a.vml.stroke.fillcolor=a.currentStyle.borderColor},vmlStrokeWeight:function(a){var c=['Top','Right','Bottom','Left'];a.bW={};for(var b=0;b<4;b++){a.bW[c[b]]=parseInt(a.currentStyle['border'+c[b]+'Width'],10)||0}},vmlOffsets:function(c){var e=['Left','Top','Width','Height'];for(var d=0;d<4;d++){c.dim[e[d]]=c['offset'+e[d]]}var f=function(a,b){a.style.left=(b?0:c.dim.Left)+'px';a.style.top=(b?0:c.dim.Top)+'px';a.style.width=c.dim.Width+'px';a.style.height=c.dim.Height+'px'};for(var v in c.vml){var g=(v=='image')?1:2;c.vml[v].coordsize=(c.dim.Width*g)+', '+(c.dim.Height*g);f(c.vml[v],true)}f(c.vmlBox,false);if(DD_roundies.IE8){c.vml.stroke.style.margin='-1px';if(typeof c.bW=='undefined'){this.vmlStrokeWeight(c)}c.vml.color.style.margin=(c.bW.Top-1)+'px '+(c.bW.Left-1)+'px'}},vmlPath:function(j){var k=function(a,w,h,r,b,c,d){var e=a?['m','qy','l','qx','l','qy','l','qx','l']:['qx','l','qy','l','qx','l','qy','l','m'];b*=d;c*=d;w*=d;h*=d;var R=r.slice();for(var i=0;i<4;i++){R[i]*=d;R[i]=Math.min(w/2,h/2,R[i])}var f=[e[0]+Math.floor(0+b)+','+Math.floor(R[0]+c),e[1]+Math.floor(R[0]+b)+','+Math.floor(0+c),e[2]+Math.ceil(w-R[1]+b)+','+Math.floor(0+c),e[3]+Math.ceil(w+b)+','+Math.floor(R[1]+c),e[4]+Math.ceil(w+b)+','+Math.ceil(h-R[2]+c),e[5]+Math.ceil(w-R[2]+b)+','+Math.ceil(h+c),e[6]+Math.floor(R[3]+b)+','+Math.ceil(h+c),e[7]+Math.floor(0+b)+','+Math.ceil(h-R[3]+c),e[8]+Math.floor(0+b)+','+Math.floor(R[0]+c)];if(!a){f.reverse()}var g=f.join('');return g};if(typeof j.bW=='undefined'){this.vmlStrokeWeight(j)}var l=j.bW;var m=j.DD_radii.slice();var n=k(true,j.dim.Width,j.dim.Height,m,0,0,2);m[0]-=Math.max(l.Left,l.Top);m[1]-=Math.max(l.Top,l.Right);m[2]-=Math.max(l.Right,l.Bottom);m[3]-=Math.max(l.Bottom,l.Left);for(var i=0;i<4;i++){m[i]=Math.max(m[i],0)}var o=k(false,j.dim.Width-l.Left-l.Right,j.dim.Height-l.Top-l.Bottom,m,l.Left,l.Top,2);var p=k(true,j.dim.Width-l.Left-l.Right+1,j.dim.Height-l.Top-l.Bottom+1,m,l.Left,l.Top,1);j.vml.color.path=o;j.vml.image.path=p;j.vml.stroke.path=n+o;this.clipImage(j)},nixBorder:function(a){var s=a.currentStyle;var b=['Top','Left','Right','Bottom'];for(var i=0;i<4;i++){a.runtimeStyle['padding'+b[i]]=(parseInt(s['padding'+b[i]],10)||0)+(parseInt(s['border'+b[i]+'Width'],10)||0)+'px'}a.runtimeStyle.border='none'},clipImage:function(e){var f=DD_roundies;if(!e.vmlBg||!f.imgSize[e.vmlBg]){return}var g=e.currentStyle;var h={'X':0,'Y':0};var i=function(a,b){var c=true;switch(b){case'left':case'top':h[a]=0;break;case'center':h[a]=0.5;break;case'right':case'bottom':h[a]=1;break;default:if(b.search('%')!=-1){h[a]=parseInt(b,10)*0.01}else{c=false}}var d=(a=='X');h[a]=Math.ceil(c?((e.dim[d?'Width':'Height']-(e.bW[d?'Left':'Top']+e.bW[d?'Right':'Bottom']))*h[a])-(f.imgSize[e.vmlBg][d?'width':'height']*h[a]):parseInt(b,10));h[a]+=1};for(var b in h){i(b,g['backgroundPosition'+b])}e.vml.image.filler.position=(h.X/(e.dim.Width-e.bW.Left-e.bW.Right+1))+','+(h.Y/(e.dim.Height-e.bW.Top-e.bW.Bottom+1));var j=g.backgroundRepeat;var c={'T':1,'R':e.dim.Width+1,'B':e.dim.Height+1,'L':1};var k={'X':{'b1':'L','b2':'R','d':'Width'},'Y':{'b1':'T','b2':'B','d':'Height'}};if(j!='repeat'){c={'T':(h.Y),'R':(h.X+f.imgSize[e.vmlBg].width),'B':(h.Y+f.imgSize[e.vmlBg].height),'L':(h.X)};if(j.search('repeat-')!=-1){var v=j.split('repeat-')[1].toUpperCase();c[k[v].b1]=1;c[k[v].b2]=e.dim[k[v].d]+1}if(c.B>e.dim.Height){c.B=e.dim.Height+1}}e.vml.image.style.clip='rect('+c.T+'px '+c.R+'px '+c.B+'px '+c.L+'px)'},pseudoClass:function(a){var b=this;setTimeout(function(){b.applyVML(a)},1)},reposition:function(a){this.vmlOffsets(a);this.vmlPath(a)},roundify:function(b){this.style.behavior='none';if(!this.currentStyle){return}else{var c=this.currentStyle}var d={BODY:false,TABLE:false,TR:false,TD:false,SELECT:false,OPTION:false,TEXTAREA:false};if(d[this.nodeName]===false){return}var e=this;var f=DD_roundies;this.DD_radii=b;this.dim={};var g={resize:'reposition',move:'reposition'};if(this.nodeName=='A'){var i={mouseleave:'pseudoClass',mouseenter:'pseudoClass',focus:'pseudoClass',blur:'pseudoClass'};for(var a in i){g[a]=i[a]}}for(var h in g){this.attachEvent('on'+h,function(){f[g[h]](e)})}this.attachEvent('onpropertychange',function(){f.readPropertyChanges(e)});var j=function(a){a.style.zoom=1;if(a.currentStyle.position=='static'){a.style.position='relative'}};j(this.offsetParent);j(this);this.vmlBox=document.createElement('ignore');this.vmlBox.runtimeStyle.cssText='behavior:none; position:absolute; margin:0; padding:0; border:0; background:none;';this.vmlBox.style.zIndex=c.zIndex;this.vml={'color':true,'image':true,'stroke':true};for(var v in this.vml){this.vml[v]=document.createElement(f.ns+':shape');this.vml[v].filler=document.createElement(f.ns+':fill');this.vml[v].appendChild(this.vml[v].filler);this.vml[v].stroked=false;this.vml[v].style.position='absolute';this.vml[v].style.zIndex=c.zIndex;this.vml[v].coordorigin='1,1';this.vmlBox.appendChild(this.vml[v])}this.vml.image.fillcolor='none';this.vml.image.filler.type='tile';this.parentNode.insertBefore(this.vmlBox,this);this.isImg=false;if(this.nodeName=='IMG'){this.isImg=true;this.style.visibility='hidden'}setTimeout(function(){f.applyVML(e)},1)}};try{document.execCommand("BackgroundImageCache",false,true)}catch(err){}DD_roundies.IEversion();DD_roundies.createVmlNameSpace();DD_roundies.createVmlStyleSheet();if(DD_roundies.IE8&&document.attachEvent&&DD_roundies.querySelector){document.attachEvent('onreadystatechange',function(){if(document.readyState=='complete'){var d=DD_roundies.selectorsToProcess;var e=d.length;var f=function(a,b,c){setTimeout(function(){DD_roundies.roundify.call(a,b)},c*100)};for(var i=0;i<e;i++){var g=document.querySelectorAll(d[i].selector);var h=g.length;for(var r=0;r<h;r++){if(g[r].nodeName!='INPUT'){f(g[r],d[i].radii,r)}}}}})}
///
// DD_roundies End
///
} else {
	throw fname+' already initialized';
}
break;

case 'ieSelectWidth':
if( !(fname in $.fn) ) {
/**
 * jQuery workaround for the cropped option in set width select.
 * http://www.jainaewen.com/files/javascript/jquery/ie-select-width/
 * Copyright (c) 2010 Ewen Elder
 * Dual licensed under the MIT and GPL licenses:
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.gnu.org/licenses/gpl.html
 *
 * @author: Ewen Elder <glomainn at yahoo dot co dot uk> <ewen at jainaewen dot com>
 * @version: 0.1.1 beta
**/ 
jQuery.fn.ieSelectWidth=function(a){var b,c,d,e,f,g,h;d=$(this);e=document;f=window;g=false;h=e.documentMode;b={width:'',containerClassName:'ie-select-width-container',overlayClassName:'ie-select-width-overlay',overlayCSS:'',containerCSS:''};a=$.extend(b,a);c={a:function(){var i=this;if(!e.all){return g}$.each(d,function(){var j=$(this);if(j.attr('multiple')||j.attr('size')>0){return g}if(!j.attr('id').length){j.attr('id',String((new Date()).getTime()).replace(/\D/gi,'').substr(8))}if(a.width!==''){j.css('width',a.width+'px')}j.data('a',j.outerWidth());i.b(j);i.c(j);$(j).css({position:'relative',top:'auto',left:'auto',bottom:'auto',right:'auto',margin:'0'})});$(d).bind('dblclick mousedown change blur',function(k){i.d(k)});$(d).bind('mousedown mouseup mouseover mouseout blur change',function(k){i.e(k)})},b:function(j){var l;if(!f.XMLHttpRequest){l='ie6'}else if(f.XMLHttpRequest&&!h){l='ie7'}else if(h){l='ie8'}j.after('<span id="'+j.attr('id')+'-container" class="'+a.containerClassName+' '+l+'"></span>');j.next().append(j);j.parent().css({position:j.css('position')==='static'?'relative':j.css('position'),display:'block',top:j.css('top'),right:j.css('right'),bottom:j.css('bottom'),left:j.css('left'),overflow:'hidden',width:j.outerWidth()+'px',margin:(j.css('margin-top')!=='auto'?j.css('margin-top'):'0')+' '+(j.css('margin-right')!=='auto'?j.css('margin-right'):'0')+' '+(j.css('margin-bottom')!=='auto'?j.css('margin-bottom'):'0')+' '+(j.css('margin-left')!=='auto'?j.css('margin-left'):'0')});if(a.containerCSS!==''){j.parent().css(a.containerCSS)}},c:function(j){var m,n,o,p,q,r,s,t,u,v,w,x,y;q=j.attr('id');v=q+'-'+a.overlayClassName;j.after('<a id="'+v+'" class="'+a.overlayClassName+'"><span></span></a>');u=$('a#'+v);if(!f.XMLHttpRequest&&($.fn.bgIframe||$.fn.bgiframe)){u.bgiframe()}u.bind('mousedown',function(){setTimeout(function(){j.focus()},1)});p=u.children('span').width();o=j.css('border-top-style')!=='none'?+j.css('border-top-width').replace('px',''):0;n=j.css('border-right-style')!=='none'?+j.css('border-right-width').replace('px',''):0;m=j.css('border-bottom-style')!=='none'?+j.css('border-bottom-width').replace('px',''):0;x=+j.css('padding-top').replace('px','');w=+j.css('padding-right').replace('px','');s=j.outerWidth()-p;y=p;r=j.outerHeight();if(h){if(n>0){s=s-(n+w);n=n+'px '+j.css('border-right-style')+' '+j.css('border-right-color')}if(o>0||m>0){r=r-(o+m)}if(w>0){y=(p+w)}t=o+'px 0';u.children('span').css({margin:x+'px 0'})}u.css({position:'absolute',display:'none',top:j.position().top+'px',left:s+'px',width:y+'px',height:r+'px',margin:t,borderRight:n});if(a.overlayCSS!==''){u.css(a.overlayCSS)}},d:function(k){var j,q,z,u,aa,ab,ac;j=$(k.target);q=j.attr('id');z=j.offset();u=$('a#'+q+'-'+a.overlayClassName);aa=k.pageX;ab=k.pageY;ac=k.type;if(ac==='dblclick'){j.css({width:j.data('a')+'px'})}if(ac==='change'||ac==='blur'||(ac==='mousedown'&&u.css('display')==='block'&&z.left<aa&&(z.left+j.data('a'))>aa&&z.top<ab&&(z.top+j.outerHeight())>ab)){return this.f(k)}if(u.css('display')==='none'){u.css('display','block')}if(!j.data('ignore')){j.css('width','auto');if(j.outerWidth()<j.parent().innerWidth()){j.css('width',j.data('a')+'px');j.data('ignore',true)}}},f:function(k){var j=$(k.target);j.siblings('a.'+a.overlayClassName+'').css('display','none');if(!j.data('ignore')){setTimeout(function(){j.css({width:j.data('a')+'px'})},1)}},e:function(k){var j,z,u,aa,ab,ac;j=$(k.target);z=j.offset();u=$('a#'+j.attr('id')+'-'+a.overlayClassName);aa=k.pageX;ab=k.pageY;ac=k.type;if(!u.length){return g}if(ac==='mousedown'&&z.left<aa&&(z.left+j.data('a'))>aa&&z.top<ab&&(z.top+j.outerHeight())>ab){u.removeClass().addClass(a.overlayClassName+' '+a.overlayClassName+'-active')}else if(ac==='mouseover'){u.removeClass().addClass(a.overlayClassName+' '+a.overlayClassName+'-hover')}else if(ac==='mouseup'||ac==='mouseout'||ac==='blur'||ac==='change'){u.removeClass().addClass(a.overlayClassName)}}};c.a()};
///
// IE select width fix
///
} else {
	throw fname+' already initialized';
}
break;

case 'tooltip':
if( !(fname in $.fn) ) {
/*
 * jQuery Tooltip plugin 1.3
 *
 * http://bassistance.de/jquery-plugins/jquery-plugin-tooltip/
 * http://docs.jquery.com/Plugins/Tooltip
 *
 * Copyright (c) 2006 - 2008 Jörn Zaefferer
 *
 * $Id: jquery.tooltip.js 5741 2008-06-21 15:22:16Z joern.zaefferer $
 * 
 * Dual licensed under the MIT and GPL licenses:
 *   http://www.opensource.org/licenses/mit-license.php
 *   http://www.gnu.org/licenses/gpl.html
 */;(function($){var helper={},current,title,tID,IE=$.browser.msie&&/MSIE\s(5\.5|6\.)/.test(navigator.userAgent),track=false;$.tooltip={blocked:false,defaults:{delay:200,fade:false,showURL:true,extraClass:"",top:15,left:15,id:"tooltip"},block:function(){$.tooltip.blocked=!$.tooltip.blocked;}};$.fn.extend({tooltip:function(settings){settings=$.extend({},$.tooltip.defaults,settings);createHelper(settings);return this.each(function(){$.data(this,"tooltip",settings);this.tOpacity=helper.parent.css("opacity");this.tooltipText=this.title;$(this).removeAttr("title");this.alt="";}).mouseover(save).mouseout(hide).click(hide);},fixPNG:IE?function(){return this.each(function(){var image=$(this).css('backgroundImage');if(image.match(/^url\(["']?(.*\.png)["']?\)$/i)){image=RegExp.$1;$(this).css({'backgroundImage':'none','filter':"progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=crop, src='"+image+"')"}).each(function(){var position=$(this).css('position');if(position!='absolute'&&position!='relative')$(this).css('position','relative');});}});}:function(){return this;},unfixPNG:IE?function(){return this.each(function(){$(this).css({'filter':'',backgroundImage:''});});}:function(){return this;},hideWhenEmpty:function(){return this.each(function(){$(this)[$(this).html()?"show":"hide"]();});},url:function(){return this.attr('href')||this.attr('src');}});function createHelper(settings){if(helper.parent)return;helper.parent=$('<div id="'+settings.id+'"><h3></h3><div class="body"></div><div class="url"></div></div>').appendTo(document.body).hide();if($.fn.bgiframe)helper.parent.bgiframe();helper.title=$('h3',helper.parent);helper.body=$('div.body',helper.parent);helper.url=$('div.url',helper.parent);}function settings(element){return $.data(element,"tooltip");}function handle(event){if(settings(this).delay)tID=setTimeout(show,settings(this).delay);else
show();track=!!settings(this).track;$(document.body).bind('mousemove',update);update(event);}function save(){if($.tooltip.blocked||this==current||(!this.tooltipText&&!settings(this).bodyHandler))return;current=this;title=this.tooltipText;if(settings(this).bodyHandler){helper.title.hide();var bodyContent=settings(this).bodyHandler.call(this);if(bodyContent.nodeType||bodyContent.jquery){helper.body.empty().append(bodyContent)}else{helper.body.html(bodyContent);}helper.body.show();}else if(settings(this).showBody){var parts=title.split(settings(this).showBody);helper.title.html(parts.shift()).show();helper.body.empty();for(var i=0,part;(part=parts[i]);i++){if(i>0)helper.body.append("<br/>");helper.body.append(part);}helper.body.hideWhenEmpty();}else{helper.title.html(title).show();helper.body.hide();}if(settings(this).showURL&&$(this).url())helper.url.html($(this).url().replace('http://','')).show();else
helper.url.hide();helper.parent.addClass(settings(this).extraClass);if(settings(this).fixPNG)helper.parent.fixPNG();handle.apply(this,arguments);}function show(){tID=null;if((!IE||!$.fn.bgiframe)&&settings(current).fade){if(helper.parent.is(":animated"))helper.parent.stop().show().fadeTo(settings(current).fade,current.tOpacity);else
helper.parent.is(':visible')?helper.parent.fadeTo(settings(current).fade,current.tOpacity):helper.parent.fadeIn(settings(current).fade);}else{helper.parent.show();}update();}function update(event){if($.tooltip.blocked)return;if(event&&event.target.tagName=="OPTION"){return;}if(!track&&helper.parent.is(":visible")){$(document.body).unbind('mousemove',update)}if(current==null){$(document.body).unbind('mousemove',update);return;}helper.parent.removeClass("viewport-right").removeClass("viewport-bottom");var left=helper.parent[0].offsetLeft;var top=helper.parent[0].offsetTop;if(event){left=event.pageX+settings(current).left;top=event.pageY+settings(current).top;var right='auto';if(settings(current).positionLeft){right=$(window).width()-left;left='auto';}helper.parent.css({left:left,right:right,top:top});}var v=viewport(),h=helper.parent[0];if(v.x+v.cx<h.offsetLeft+h.offsetWidth){left-=h.offsetWidth+20+settings(current).left;helper.parent.css({left:left+'px'}).addClass("viewport-right");}if(v.y+v.cy<h.offsetTop+h.offsetHeight){top-=h.offsetHeight+20+settings(current).top;helper.parent.css({top:top+'px'}).addClass("viewport-bottom");}}function viewport(){return{x:$(window).scrollLeft(),y:$(window).scrollTop(),cx:$(window).width(),cy:$(window).height()};}function hide(event){if($.tooltip.blocked)return;if(tID)clearTimeout(tID);current=null;var tsettings=settings(this);function complete(){helper.parent.removeClass(tsettings.extraClass).hide().css("opacity","");}if((!IE||!$.fn.bgiframe)&&tsettings.fade){if(helper.parent.is(':animated'))helper.parent.stop().fadeTo(tsettings.fade,0,complete);else
helper.parent.stop().fadeOut(tsettings.fade,complete);}else
complete();if(settings(this).fixPNG)helper.parent.unfixPNG();}})(jQuery);
///
// tooltip End
///
} else {
	throw fname+' already initialized';
}
break;

default:
throw fname?fname+' could not be initialized':'Pass something to initialize';
} // switch(fname)
} // ML.init
