if (window.document) {
	function mys_url_encode(s) {
		ue = self.encodeURIComponent ? encodeURIComponent : escape;
		return ue( s ).replace( /\+/g, '%20' ).replace( /!/g, '%21' ).replace( /'/g, '%27' ).replace( /\(/g, '%28' ).replace( /\)/g, '%29' ).replace( /\* /g, '%2A' ).replace( /\~/g, '%7E' );
	}

	function mys_url_decode(s) {
		ud = self.decodeURIComponent ? decodeURIComponent : unescape;
		return ud( s.replace( /\%20/g, '+' ).replace( /\%21/g, '!' ).replace( /\%27/g, "'" ).replace( /\%28/g, '(' ).replace( /\%29/g, ')' ).replace( /\%2A/g, '*' ).replace( /\%7E/g, '~' ) );
	}

	//event functions
	_ehmysh =  function() {
		 this._mys_addEvent = function (element, type, handler) {
			if (element.addEventListener) {
				element.addEventListener(type, handler, false);
			} else {
				if (!handler.$$guid) handler.$$guid = this._mys_addEvent.guid++;
				if (!element.events) element.events = {};
				var handlers = element.events[type];
				if (!handlers) {
					handlers = element.events[type] = {};
					if (element["on" + type]) {
						handlers[0] = element["on" + type];
					}
				}
				handlers[handler.$$guid] = handler;
				element["on" + type] = this._mys_handleEvent;
			}
		};
		this._mys_addEvent.guid = 1;

		this._mys_removeEvent = function(element, type, handler) {
			if (element.removeEventListener) {
				element.removeEventListener(type, handler, false);
			} else {
				if (element.events && element.events[type]) {
					delete element.events[type][handler.$$guid];
				}
			}
		};
		this._mys_handleEvent = function(event) {
			var returnValue = true;
			event = event || _mys_fixEvent(((this.ownerDocument || this.document || this).parentWindow || window).event);
			var handlers = this.events[event.type];
			for (var i in handlers) {
				this.$$_mys_handleEvent = handlers[i];
				if (this.$$_mys_handleEvent(event) === false) {
					returnValue = false;
				}
			}
			return returnValue;
		};
		function _mys_fixEvent(event) {
			event.preventDefault = _mys_fixEvent.preventDefault;
			event.stopPropagation = _mys_fixEvent.stopPropagation;
			return event;
		};
		_mys_fixEvent.preventDefault = function() {
			this.returnValue = false;
		};
		_mys_fixEvent.stopPropagation= function() {
			this.cancelBubble = true;
		};
	}

	_mysin = function() {
		var isMBD = false;
		var modalBox;

		this.getDocHeight = function() {
			var D = document;
			return Math.max(
				Math.max(D.body.scrollHeight, D.documentElement.scrollHeight),
				Math.max(D.body.offsetHeight, D.documentElement.offsetHeight),
				Math.max(D.body.clientHeight, D.documentElement.clientHeight)
			);
		}

		//modal functions
		this.pageWidth = function() {
			return window.innerWidth != null? window.innerWidth: document.documentElement && document.documentElement.clientWidth ? document.documentElement.clientWidth:document.body != null? document.body.clientWidth:null;
		}
		this.pageHeight = function() {
			return window.innerHeight != null? window.innerHeight: document.documentElement && document.documentElement.clientHeight ? document.documentElement.clientHeight:document.body != null? document.body.clientHeight:null;
		}
		this.posLeft = function() {
			return typeof window.pageXOffset != 'undefined' ? window.pageXOffset:document.documentElement && document.documentElement.scrollLeft? document.documentElement.scrollLeft:document.body.scrollLeft? document.body.scrollLeft:0;
		}
		this.posTop = function() {
			return typeof window.pageYOffset != 'undefined' ? window.pageYOffset:document.documentElement && document.documentElement.scrollTop? document.documentElement.scrollTop: document.body.scrollTop?document.body.scrollTop:0;
		}
		this.elemID = function(x){
			return document.getElementById(x);
		}
		this.scrollFix = function(){
			var obol=this.elemID('ol');
			if (obol) {
				obol.style.top=this.posTop()+'px';
				obol.style.left=this.posLeft()+'px';
			}
		}
		this.sizeFix = function(){
			var obol=this.elemID('ol');
			if (obol) {
				obol.style.height=this.pageHeight()+'px';
				obol.style.width=this.pageWidth()+'px';
			}
		}
		this.kp = function(e){
			ky=e?e.which:event.keyCode;
			if(ky==88||ky==120)hm();
			return false;
		}
		this.inf = function(h){
			tag=document.getElementsByTagName('select');
			for(i=tag.length-1;i>=0;i--)
				tag[i].style.visibility=h;
			tag=document.getElementsByTagName('iframe');
			for(i=tag.length-1;i>=0;i--)
				tag[i].style.visibility=h;
			tag=document.getElementsByTagName('object');
			for(i=tag.length-1;i>=0;i--)
				tag[i].style.visibility=h;
		}

		this.sm = function(obl,wd, ht){
			var h='hidden';
			var b='block';
			var p='px';
			var obol=this.elemID('mys_ol');
			var obbxd = this.elemID('mys_bd');
			tmp = this.elemID(obl).innerHTML;
			obbxd.innerHTML = tmp;
			obol.style.height=this.getDocHeight() +p;
			obol.style.width='100%'
			obol.style.top=0;
			obol.style.left=0;
			obol.style.display=b;
			var tp=this.posTop()+((this.pageHeight()-ht)/2)-12;
			var lt=this.posLeft()+((this.pageWidth()-wd)/2)-12;
			var obbx=this.elemID('mys_box');
			obbx.style.top=(tp<0?0:tp)+p;
			obbx.style.left=(lt<0?0:lt)+p;
			obbx.style.width=wd+p;
			obbx.style.height=ht+p;
			this.inf(h);
			obbx.style.display=b;
			return false;
		}

		this.hm = function(){
			var v='visible';
			var n='none';
			this.elemID('mys_ol').style.display=n;
			this.elemID('mys_box').style.display=n;
			this.inf(v);
			document.onkeypress='';
		}

		this.initmb = function(){
			if (!isMBD) {
				var ab='absolute';
				var n='none';
				var obody=document.getElementsByTagName('body')[0];
				var frag=document.createDocumentFragment();
				var obol=document.createElement('div');
				obol.setAttribute('id','mys_ol');
				frag.appendChild(obol);

				var obbx=document.createElement('div');
				obbx.setAttribute('id','mys_box');

				var obbxd=document.createElement('div');
				obbxd.setAttribute('id','mys_bd');
				obbx.appendChild(obbxd);
				frag.insertBefore(obbx,obol.nextSibling);
				obody.insertBefore(frag,obody.firstChild);

				//iframe
				var obbxi=document.createElement('iframe');
				obbxi.setAttribute('id','mys_boxframe');
				obbxi.setAttribute('name','mys_boxframe');
				obbxi.style.display='none';
				obody.appendChild(obbxi);

				window.onscroll = this.scrollFix;
				window.onresize = this.sizeFix;

				isMBD = true;
			}
		}

		s_mys = function(elem){
			newurl = elem.getAttribute('myshare_url');
			if (newurl=='')
				newurl = elem.getAttribute('myshare:url');
			
			lang = elem.getAttribute('myshare_lang');
			if (lang=='')
				lang = elem.getAttribute('myshare:lang');
			
			mysshort_tag = elem.getAttribute('myshare_short');
			if (mysshort_tag=='')
				mysshort_tag = elem.getAttribute('myshare:short');

			if (!this.elemID('mys_box'))
				this.initmb();

			var a = new _ehmysh();
			a._mys_addEvent(this.elemID('mys_ol'), "click", _mysin.hm);

			//newurl
			var i =0;
			var tourl;
			var tourl_link;
			var tourl_title;
			var alist = document.getElementsByTagName('a');

			if (newurl) {
				tourl = newurl;
				tourl_link = mys_url_encode(newurl);
				
				newtitle = elem.getAttribute('myshare_title');
				if (newtitle=='')
					newtitle = elem.getAttribute('myshare:title');
					
				newdescription = elem.getAttribute('myshare_description');
				if (newdescription=='')
					newdescription = elem.getAttribute('myshare:description');
				
				if (newtitle) {
					tourl_link = tourl_link + "&t=" +mys_url_encode(newtitle);
					tourl_title = newtitle;
				}
				if (newdescription) {
					tourl_link = tourl_link + "&d=" +mys_url_encode(newdescription);
				}
			} else {
				tourl = location.href;
				tourl_link = mys_url_encode(location.href);
				newtitle = document.title;
				tourl_title = newtitle;

				if (newtitle) {
					tourl_link = tourl_link + "&t=" +mys_url_encode(newtitle);
				}
				var metas = document.getElementsByTagName('meta');
				len = metas.length;

				if (len>0) {
					var newdescription;
					for (var x=0,y=metas.length; x<y; x++) {
						if (metas[x].name.toLowerCase() == "description") {
							newdescription = metas[x];
						}
					}
					if (newdescription) {
						if (newdescription.content) {
							tourl_link = tourl_link + "&d=" +mys_url_encode(newdescription.content);
						}
					}
				}
			}

			if (lang) {
				tourl_link = tourl_link + "&l=" +mys_url_encode(lang);
			}

			if (mysshort_tag || self._mysshort) {
				tourl_link = tourl_link + "&shrt=1";
			}
			
			var tmp = self.location.host;
			if ( !tmp )
				tmp = '';
			tourl_link = tourl_link + "&f="+mys_url_encode(tmp);

			//cambia i link
			while (element = alist[i++]) {
				if (element.className == "mys_partners") {
					c = element.href;
					y = c.indexOf('&');

					if (y>0) {
						c = c.substr(0,y);
					}
					if (c.indexOf('?')>0) {
						element.href = c +"&u=" + tourl_link;
					} else {
						element.href = c +"?u=" + tourl_link;
					}
				}
			}

			//cambia i link
			i =0;
			var inputlist = document.getElementsByTagName('input');
			while (element_i = inputlist[i++]) {
				if (element_i.className == "mys_form_url") {
					element_i.value = tourl;
				} else if (element_i.className == "mys_form_title") {
					element_i.value = tourl_title;
				}
			}

			this.sm('myshare_box', 360,290);
			return false;
		}
		h_mys = function(){
			this.hm();
			return false;
		}

		return {
			sm: function() {s_mys(this); _mysobj.tab(1);},
			hm: function() {h_mys();}
		}
	}()

	_mysst = function(){
		var a = new _ehmysh();

		if (!window._mysstinst) {
			var _mysstinst;
			window._mysstinst = true;
			var head = document.getElementsByTagName('head')[0];
			var cssins = document.createElement("link");
			cssins.rel = "stylesheet";
			cssins.type = "text/css";
			cssins.href = "http://css.adv.dadapro.net/myshare/model/default/style.css?ver=1.40";
			cssins.media = "all";
			head.appendChild(cssins);

			var body = document.getElementsByTagName('body')[0];
			var htmladd = document.createElement("div");
			htmladd.id = "myshare_htmladd";
			body.appendChild(htmladd);
			document.getElementById('myshare_htmladd').innerHTML = '<div id="myshare_box" style="display:none;"><div id="myshare_window"><div id="mys_tab_1" class="mys_tab" style="display:none;"><div class="mys_top"><p class="mys_top_title">SHARE<\/p><div class="mys_logo"><\/div><input type="button" name="close" class="close" onclick="_mysin.hm()" value="X"><div class="mys_ttab"><ul><li class="mys_t1l"><span>social network<\/span><\/li><li class="mys_t1r"><a class="mys_textlink" href="javascript:void(0);" onclick="_mysobj.tab(2); if (document.getElementById(\'mys_captcha_loaded\').value==0){document.getElementById(\'mys_captcha_img\').src=\'http:\/\/www.share-widget.com\/captchapro.php5?op=send&cnt=\'+((new Date()).getTime());document.getElementById(\'mys_captcha_loaded\').value = 1;}">email<\/a><\/li><\/ul><\/div><\/div><div id="s-1" class="mys_box" style="display:none"><div class="mys_best"><ul><li><a href="http:\/\/www.share-widget.com\/myshare.php5?p=facebook" class="mys_partners" target="_blank"><span style="background-position:0 -4288px;width:16px;height:16px;"><\/span>Facebook<\/a><\/li><li><a href="http:\/\/www.share-widget.com\/myshare.php5?p=twitter" class="mys_partners" target="_blank"><span style="background-position:0 -3856px;width:16px;height:16px;"><\/span>Twitter<\/a><\/li><li><a href="http:\/\/www.share-widget.com\/myshare.php5?p=savenkeep" class="mys_partners" target="_blank"><span style="background-position:0 -4863px;width:16px;height:16px;"><\/span>Save \'n Keep<\/a><\/li><\/ul><\/div><div class="clearer"><\/div><div class="mys_partners_list"><div class="mys_partners_col"><ul><li><a href="http:\/\/www.share-widget.com\/myshare.php5?p=aim" class="mys_partners" target="_blank"><span style="background-position:0 -592px;width:16px;height:16px;"><\/span>Aim<\/a><\/li><li><a href="http:\/\/www.share-widget.com\/myshare.php5?p=baidu" class="mys_partners" target="_blank"><span style="background-position:0 -2960px;width:16px;height:16px;"><\/span>Baidu<\/a><\/li><li><a href="http:\/\/www.share-widget.com\/myshare.php5?p=bebo" class="mys_partners" target="_blank"><span style="background-position:0 -3216px;width:16px;height:16px;"><\/span>Bebo<\/a><\/li><li><a href="http:\/\/www.share-widget.com\/myshare.php5?p=blogger" class="mys_partners" target="_blank"><span style="background-position:0 -1856px;width:16px;height:16px;"><\/span>Blogger<\/a><\/li><li><a href="http:\/\/www.share-widget.com\/myshare.php5?p=delicious" class="mys_partners" target="_blank"><span style="background-position:0 -2240px;width:16px;height:16px;"><\/span>Delicious<\/a><\/li><\/ul><\/div><div class="mys_partners_col"><ul><li><a href="http:\/\/www.share-widget.com\/myshare.php5?p=digg" class="mys_partners" target="_blank"><span style="background-position:0 -2288px;width:16px;height:16px;"><\/span>Digg<\/a><\/li><li><a href="http:\/\/www.share-widget.com\/myshare.php5?p=friendfeed" class="mys_partners" target="_blank"><span style="background-position:0 -3312px;width:16px;height:16px;"><\/span>Friendfeed<\/a><\/li><li><a href="http:\/\/www.share-widget.com\/myshare.php5?p=linkedin" class="mys_partners" target="_blank"><span style="background-position:0 -3248px;width:16px;height:16px;"><\/span>Linkedin<\/a><\/li><li><a href="http:\/\/www.share-widget.com\/myshare.php5?p=myspace" class="mys_partners" target="_blank"><span style="background-position:0 -4128px;width:16px;height:16px;"><\/span>Myspace<\/a><\/li><li><a href="http:\/\/www.share-widget.com\/myshare.php5?p=netlog" class="mys_partners" target="_blank"><span style="background-position:0 -3824px;width:16px;height:16px;"><\/span>Netlog<\/a><\/li><\/ul><\/div><div class="mys_partners_col"><ul><li><a href="http:\/\/www.share-widget.com\/myshare.php5?p=orkut" class="mys_partners" target="_blank"><span style="background-position:0 -3792px;width:16px;height:16px;"><\/span>Orkut<\/a><\/li><li><a href="http:\/\/www.share-widget.com\/myshare.php5?p=reddit" class="mys_partners" target="_blank"><span style="background-position:0 -3072px;width:16px;height:16px;"><\/span>Reddit<\/a><\/li><li><a href="http:\/\/www.share-widget.com\/myshare.php5?p=stumbleupon" class="mys_partners" target="_blank"><span style="background-position:0 -2944px;width:16px;height:16px;"><\/span>Stumbleupon<\/a><\/li><li><a href="http:\/\/www.share-widget.com\/myshare.php5?p=tumblr" class="mys_partners" target="_blank"><span style="background-position:0 -576px;width:16px;height:16px;"><\/span>Tumblr<\/a><\/li><li><a href="http:\/\/www.share-widget.com\/myshare.php5?p=viadeo" class="mys_partners" target="_blank"><span style="background-position:0 -4320px;width:16px;height:16px;"><\/span>Viadeo<\/a><\/li><\/ul><\/div><br class="cb" \/><div class="mys-arrows"><input type="button" onclick="_mysobj.move(-1);"  id="tab_1-arrow-prev" class="arrow-prev" \/><input type="button" onclick="_mysobj.move(+1);" id="tab_1-arrow-next" class="arrow-next" \/><\/div><\/div><\/div><\/div><div id="mys_tab_2" class="mys_tab" style="display:none;"><div class="mys_top"><p class="mys_top_title">SHARE<\/p><div class="mys_logo"><\/div><input type="button" name="close" class="close" onclick="_mysin.hm()" value="X"><div class="mys_ttab"><ul><li class="mys_t1l"><span>social network<\/span><\/li><li class="mys_t1r"><a class="mys_textlink" href="javascript:void(0);" onclick="_mysobj.tab(2);">email<\/a><\/li><\/ul><\/div><div class="mys_ttab"><ul><li class="mys_t2l"><a class="mys_textlink" href="javascript:void(0);" onclick="_mysobj.tab(1);" style="text-decoration: none">social network<\/a><\/li><li class="mys_t2r"><span>email<\/span><\/li><\/ul><\/div><\/div><div><form name="form_send" method="post" onsubmit="return _mysobj.send(this);" target="mys_boxframe" action="http:\/\/www.share-widget.com\/send.php5" class="form-send-mail"><div class="box-send-mail"><input type="hidden" class="mys_form_url" name="url" value="http:\/\/www.share-widget.com\/content_js.php5" \/><input type="hidden" class="mys_form_title" name="title" value="" \/><input type="hidden" id="mys_captcha_loaded" name="mys_captcha_loaded" value="0" \/><input type="hidden" class="mys_form_lang" name="lang" value="en" \/><input type="hidden" class="mys_form_from" name="from" value="" \/><label for="mys-send-mail" class="label-send-mail">Your friend email<\/label><input class="send-mail" id="mys-send-mail" type="text" name="mail[to]"\/><div class="clearer">&nbsp;<\/div><label for="mys-send-mail2" class="label-send-mail">Your name<\/label><input class="send-mail" id="mys-send-mail2" type="text" name="mail[name]"\/><div class="clearer">&nbsp;<\/div><label for="mys-send-mail3" class="label-send-mail">Your email<\/label><input class="send-mail" id="mys-send-mail3" type="text" name="mail[from]"\/><div class="clearer">&nbsp;<\/div><label for="mys-send-mail4" class="label-send-mail">Message<\/label><textarea rows="3" cols="25" class="send-text" id="mys-send-mail4" name="mail[text]"><\/textarea><div class="clearer">&nbsp;<\/div><div class="box-seccode"><label for="my-seccode" class="label-seccode">Security code<\/label><input type="text" class="mys_captcha" id="my-seccode" name="capcode" size="10" autocomplete="off"><\/div><a href="javascript:void(0);" class="mys_capcha" title="reload"><img class="mys_cap-code" align="absmiddle" id="mys_captcha_img" onclick="javascript:this.src = \'http:\/\/www.share-widget.com\/captchapro.php5?op=send&ct\'+((new Date()).getTime());return false;"\/><\/a><input type="submit" onmouseover="javascript:this.className=\'button_hover\'" onmouseout="javascript:this.className=\'button\'" class="button" alt="Send" value="Send" \/><\/div><\/form><\/div><\/div><div class="clearer"><\/div><div class="mys_foo"><div id="mys_footersel_1"><div class="gohome"><a href="http:\/\/www.share-widget.com?from=share-widget" target="_blank" class="gohome_sw"><\/a><\/div><\/div><div id="mys_footersel_2"><div class="gohome"><a href="http:\/\/www.share-widget.com?from=share-widget" target="_blank" class="gohome_sw"><\/a><a href="http:\/\/www.x.nu?from=share-widget" target="_blank" class="gohome_xnu"><\/a><\/div><\/div><\/div><\/div><\/div>';

			var script = document.createElement('script');
			script.type = 'text/javascript';
			script.onload = script.onreadystatechange = function() {
				if ( !this.readyState || this.readyState === "loaded" || this.readyState === "complete" ) {
					window._mysobj = new _mys();
					window._mysobj.dict = {"error_mail_to" : "Mail not correct","error_mail_name" : "Name is not correct","error_mail_from" : "Your mail is not correct","capcode_not_correct":"Security code is not correct","mail_to":"Your friend email", "your_name":"Your name", "your_mail":"Your email", "security_code":"Security code"};
					window._mysobj.c_tab = '1';
					window._mysobj.init();

					// Handle memory leak in IE
					script.onload = script.onreadystatechange = null;
					if ( head && script.parentNode ) {
						head.removeChild( script );
					}
				}
			};
			script.src = 'http://js.adv.dadapro.net/myshare/model/default/scripts.js?ver=1.33';
			head.appendChild(script);
		}

		var i = 0;
		var mya = new Array();
		var aclas;
		aclas= document.getElementsByTagName("a");
		while (element = aclas[i++]) {
			if (element.getAttribute('myshare:id') == "mys_shareit" || element.getAttribute('myshare_id') == "mys_shareit") {
				mya.push(element);
			}
		}

		i = mya.length;
		if (i>0) {
			a._mys_addEvent(mya[i-1], "click", _mysin.sm);
		}

	}()

} else {
	_mysstinst.inst++
}
