/*	code adapted from http://regretless.com/dodo/newworld */
function MDHPopUp(url,w,h,windowName) {
	var windowRef = 'ImagePopup';
	var features =
	',directories=no' + 
	',location=no'    + 
	',menubar=no'     + 
	',scrollbars=no'  + 
	',status=no'      + 
	',toolbar=no'     + 
	',resizable=no';
	features += ',width='+w;
	features += ',height='+h;
			
	var 	htmlout = 	'<html><head><title>'+windowName+'</title><style type="text/css">body{margin:0;padding:0;}</style></head>';
	htmlout +=	'<body marginheight=0 topmargin=0 vspace=0 marginwidth=0 leftmargin=0 hspace=0>';
	htmlout += 	'<div style="position:absolute;top:0px;left:0px"><img vspace=0 hspace=0 src="'+url+'" onclick="javascript:window.close()"/></div></body></html>';
	
	//		var win=window.open(url,windowRef,features);
	var win=window.open('',windowRef,features);
	win.document.open();
	win.document.write(htmlout);
	win.document.close();
	win.focus();
}

function klik(e)
{
	posx = 0;
	posy = 0;
	if (!e) var e = window.event;
	if (e.pageX || e.pageY)
	{
		posx = e.pageX;
		posy = e.pageY;
	}
	else if (e.clientX || e.clientY)
	{
		posx = e.clientX + document.body.scrollLeft;
		posy = e.clientY + document.body.scrollTop;
	}
	
SetCookie('x',posx,1);
SetCookie('y',posy,1);


}

function SetCookie(cookieName,cookieValue,nDays) {
 var today = new Date();
 var expire = new Date();
 if (nDays==null || nDays==0) nDays=1;
 expire.setTime(today.getTime() + 3600000*24*nDays);
 document.cookie = cookieName+"="+escape(cookieValue)
                 + ";expires="+expire.toGMTString();
}

function link(thelink)
{
	location.href = "index.php?page="+thelink;
}

function link_en(thelink)
{
	location.href = "index_en.php?page="+thelink;
}

function storylink(thelink,theid)
{
location.href = "index.php?&page="+thelink+"&id="+theid;
}