$(function(){
	popLink=$('#popNew');
	$(popLink).click(function(){
		return mdwong_pop(this, 'site');
	});
});
function shopic(src,x,y,auto){
if (auto){
	var autoy = 0;
	if (auto.offsetParent){
		while (auto.offsetParent){
			autoy += auto.offsetTop
			auto = auto.offsetParent;
		}
	}
	else if (auto.y) autoy += auto.y;
	var autox = 0;
	if (auto.offsetParent){
		while (auto.offsetParent){
			autox += auto.offsetLeft
			auto = auto.offsetParent;
		}
	}
	else if (auto.x) autox += auto.x;
	x+=autox;
	y+=autoy;
}
var altmessage = 'Click to hide the image.';
var content="<a href=\"#\" onclick=\"shopic(0,0,0);return false;\"><img src=\"";
content=content+src+"\" alt=\""+altmessage+"\" border=\"0\"";
content=content+" /></a>";
if (document.getElementById){
	if (src!=0){
		if (document.getElementById('shothumb')==null){
			picBox = document.createElement("div");
			picLink = document.createElement("a");
			pic = document.createElement("img");
			pic.setAttribute('src',src);
			pic.setAttribute('id','shoImg');
			pic.setAttribute('border',0);
			picLink.setAttribute('href','javascript:shopic(0,0,0)');
			picLink.setAttribute('title',altmessage);
			picLink.appendChild(pic);
			picBox.appendChild(picLink);
			document.getElementById('picBlock').appendChild(picBox);
			picBox.setAttribute('id','shothumb');
			document.getElementById('shothumb').style.display="block";
			document.getElementById('shothumb').style.position='absolute';
			document.getElementById('shothumb').style.top=y+"px";
			document.getElementById('shothumb').style.left=x+"px";
		}
		else {
			oldparent=document.getElementById('shothumb').childNodes[0];	
			oldparent.removeChild(oldparent.childNodes[0]);
			pic = document.createElement("img");
			pic.setAttribute('src',src);
			pic.setAttribute('id','shoImg');
			pic.setAttribute('border',0);
			picLink.appendChild(pic);
			document.getElementById('shoImg').setAttribute('src',src);
			document.getElementById('shothumb').style.display="block";
			document.getElementById('shothumb').style.position='absolute';
			document.getElementById('shothumb').style.top=y+"px";
			document.getElementById('shothumb').style.left=x+"px";
		}
	}
	else {
		document.getElementById('shothumb').style.display="none";
	}
}
else{self.location=src;}

}
function mdwong_pop(path,pop_name,options)
{
	if(!options)
   {
options="width=788,height=484,location=yes,menubar=yes,toolbar=yes,scrollbars,resizable=yes,status=yes";
   }
	if(path)
   {
		if(!pop_name)
      {
			var n = path.split("/");
			var temp = n[n.length-1];
			n = temp.split(".");
			pop_name = n[0];
		}	
		mdwong_popwin = window.open(path,pop_name,options);
      	if(window.focus) {mdwong_popwin.focus();}
		return false;
    }
}
function pic_pop(path,pop_name,options)
{
	if(!options)
   {
options="width=428,height=428,location=no,menubar=no,toolbar=no,scrollbars,resizable=yes,status=no";
   }
	if(path)
   {
		if(!pop_name)
      {
			var n = path.split("/");
			var temp = n[n.length-1];
			n = temp.split(".");
			pop_name = n[0];
		}	
		pic_popwin = window.open(path,pop_name,options);
       	if(window.focus) {pic_popwin.focus();}
    }
}

