/*
h2g_scripts by Mick Mckenna
---------------------------------------------

Version History
---------------
13-10-2009 - version 1.0

*/
function checksize(id){
	//not in use
var img = document.getElementById(id);
var size = false
if (img.height > 600 ){
size = true
}
if (img.width > 800){
size = true
}
if (size == true){
//the image is to big add code here
alert("image 600");
}
else
{
// the image is the right size
alert("image 600");
}
}

var newwindow;
var windowname= "picture";
function free_win(url,name)
{
	newwindow=window.open(url,'name','height=500,width=324');
	if (window.focus) {newwindow.focus()}
}
function popup(mylink, mwidth, mheight)
{
var width = mwidth + 20
var height = mheight + 20

var newlink = mylink
	var left = parseInt((screen.availWidth/2) - (width/2));
    var top = parseInt((screen.availHeight/2) - (height/2));
if (! window.focus)return true;
var href;
if (typeof(newlink) == 'string')
   href=newlink;
else
   href=newlink.href;
    var windowFeatures = "width=" + width + ",height=" + height + ",status,resizable,scrollbars,left=" + left + ",top=" + top + "screenX=" + left + ",screenY=" + top;
window.open(href, windowname, windowFeatures);
return false;
}
	
var newswind
function news_wind(url, mwidth, mheight) {
    var width = 850;
    var height = 600;
	width = mwidth;
	height = mheight;
    var left = parseInt((screen.availWidth/2) - (width/2));
    var top = parseInt((screen.availHeight/2) - (height/2));
    var windowFeatures = "width=" + width + ",height=" + height + ",status,resizable,scrollbars,left=" + left + ",top=" + top + "screenX=" + left + ",screenY=" + top;
    newswind = window.open(url, "subWind", windowFeatures);
}