	(function() {
	d=document;w=window;
	_=function(i){return d.getElementById(i);}
	__=function(i){return d.getElementsByTagName(i);}		
	div=function(){var e = d.createElement("div");e.style.padding="0";e.style.margin="0";e.style.border="0";e.style.position="relative";return e;}
	width=function(){var s = 0;if(typeof( w.innerWidth) == 'number' ) {s = window.innerWidth;}else if(d.documentElement && (d.documentElement.clientWidth) ){s = d.documentElement.clientWidth;}else if( d.body && ( d.body.clientWidth) ) {s = d.body.clientWidth;}return s;}
	rEle=function(e){try{_(e).parentNode.removeChild(_(e))}catch(e){}}
	function sh(){var h = w.pageYOffset || d.body.scrollTop || d.documentElement.scrollTop; return h ? h : 0;}
	if(typeof(_pc_siteurl)!='undefined'){phpcamp_siteurl=_pc_siteurl}else{phpcamp_siteurl=window.location}
	var phpcamp_vote = '<iframe src="http://phpcamp.net/index.php/api/vote?loc='+encodeURIComponent(phpcamp_siteurl)+'&vote="';
	phpcamp_vote += ' height="50" width="90" scrolling="no" frameborder="0" id="PHPCamp_loginFrame"></iframe>';
	document.write(phpcamp_vote);
	ca=function(){var a=location.href.split("#p:")[1];if(a=="share"){replace();share();}else if(a=="login"){replace();login();}else if(a=="loginSuccess"){replace();loginSuccess();}else if(a=="close"){replace();close();}};setInterval(ca, 500);
	share=function(){var e=document.createElement('script');d=document;e.setAttribute('type','text/javascript');e.setAttribute('src','http://phpcamp.net/index.php/bookmarklet');d.body.appendChild(e);}
	login=function()
	{
		if(_('PHPCamp_container')){return;}
		divWidth=500;divHeight=425;mLeft = (width()-divWidth)/2;
		b=div();b.style.marginLeft = mLeft+"px";b.style.position="fixed";b.style.top="0px";b.style.width=divWidth+"px";b.style.height=divHeight+"px";b.id="PHPCamp_container";
		inMargin="10";
		frameUrl="http://phpcamp.net/index.php/api/login?loc="+encodeURIComponent(location.href)+"&placeholder=";
		b.innerHTML='<div style="z-index:99999;margin:0;width:100%;height:100%;position:absolute;background-color:black;filter:alpha(opacity=3);opacity: 0.3"></div><div id="PHPCamp_iframeParent" style="padding:0px;background:white;z-index: 100000;position:absolute;margin:'+inMargin+'px;width:'+(divWidth-(2*inMargin))+'px;height:'+(divHeight-(2*inMargin))+'px"><input onclick="__(\'body\')[0].removeChild(_(\'PHPCamp_container\'))" type="button" style="cursor:pointer;width:25px;height:25px;float:right;background:url(http://files.phpcamp.net/images/close.png) no-repeat;border:0px;" ><iframe frameborder="0" id="PHPCamp_iframe" src="'+frameUrl+'" style="width:100%;height:380px;border:0px;padding:0px;margin:0px"></iframe><div id="PHPCamp_m"></div></div>';
		d.body.appendChild(b);
	};
	loginSuccess=function()
	{
		close();
		var f = document.getElementById('PHPCamp_loginFrame');
		f.src = f.src;
	};
	replace=function()
	{
		str = location.href.split("#p:")[0] + "#";
		location.replace(str.replace(new RegExp("[#]+$", "g"), "")+"#");
	};
	close=function()
	{
		sp=sh();rEle('PHPCamp_container');w.scrollTo(0,sp);
	}
	})()
