<!--
function sizeImgWH(obj, _w, _h) {
    var tmpImg = new Image();
    tmpImg.src = obj.src;
    if (tmpImg.height > _h) { obj.height = _h; }
    if (tmpImg.width > _w) { obj.width = _w; }

}

function SIP(obj, _w, _h) {
  /////////////// this is the correct function is proportional to change size
  var tmpImg = new Image();
  tmpImg.src = obj.src;
  //alert(tmpImg.width)
  if (_w/tmpImg.width > _h/tmpImg.height) {
  	if (tmpImg.width > _w) {
      obj.height = tmpImg.height*(_w/tmpImg.width);
      obj.width = _w;
    }
    if (tmpImg.height > _h) {
		  obj.width = tmpImg.width*(_h/tmpImg.height);
		  obj.height = _h;
    }
	} else {
    if (tmpImg.height > _h) {
		  obj.width = tmpImg.width*(_h/tmpImg.height);
		  obj.height = _h;
    }
  	if (tmpImg.width > _w) {
      obj.height = tmpImg.height*(_w/tmpImg.width);
      obj.width = _w;
    }
  }
}


var overImg = null;
var normImg = null;

var loadDone = false;

var hwnd = null;

////////////////////////////////////////////////////////////////////////

/* function for body.onLoad */

function initPage() {
	preloadMenu(7);
	loadDone = true;
}

////////////////////////////////////////////////////////////////////////

/* functions for menu and other images */
function preloadMenu(count) {
	overImg = new preloadImages(count,'/data/images/menu/menu-','-on.gif')
	normImg = new preloadImages(count,'/data/images/menu/menu-','-off.gif')
}

function preloadImages(length, path, type) {
    for(var i = 1; i <= length; i++) {
	this[i]= new Image();
	this[i].src= path + i + type;
    }
    return this;
}

function rollOn(num) {
    if(loadDone && document.images) { 
	eval('document.images["m-'+num+'"].src='+'overImg[num].src')
    }
}

function rollOff(num) {
    if(loadDone && document.images){
	eval('document.images["m-'+num+'"].src='+'normImg[num].src')
    }
}

function sizeImg(obj, _width) {
    var tmpImg = new Image();
    tmpImg.src = obj.src;
    if (tmpImg.width > _width) { obj.width = _width; }
}

////////////////////////////////////////////////////////////////////////

/* function to open print\email window */

function PrinterFriendly(url) {
    var width = 700,
        height = 550;

    remote = window.open("http://" + getDomainName() + url, "opener", "scrollbars=1,resizable=1,toolbar=1,left=" + ((screen.availWidth  - width) / 2) + ",top=" + ((screen.availHeight  - height) / 2) + ",width=" + width + ",height=" + height);

    if (remote.opener == null) remote.opener = window;
}

function getDomainName() {
	var url = window.location.href;
	var end = url.indexOf("/", 7);
	if (end == -1) { end = url.length; }
	return url.substring(7, end);
}

/* function that show tip on your status bar when you take mouse over print\email link */
function showText(obj) {
    obj.onmouseout = function() { window.status = ""; }
    window.status = obj.innerText;
}

function showPoll(url) {
    if (hwnd == null || (hwnd != null && hwnd.closed)) {
	hwnd = showWindow(url);
    } else { hwnd.focus(); }
}

function showWindow(url) {
    var width = 500,
        height = 400;

    hwnd = window.open(url, "Results", "left=" + ((screen.availWidth  - width) / 2) + ",top=" + ((screen.availHeight  - height) / 2) + ",width=" + width + ",height=" + height + ",titlebar=1,resizable=1,scrollbars=1");
    hwnd.focus();

    return hwnd;
}

////////////////////////////////////////////////////////////////////////

/* functions that check different forms for correct information */

function checkRegForm(formobj) {
    with(formobj) {
	if (email.value.length == 0) { alert("Please, enter your email."); email.focus(); return false; }
	if (!checkEmail(email.value)) { alert("Please, enter valid email address."); email.focus(); return false; }
	if (cemail.value.length == 0) { alert("Please, confirm your email."); cemail.focus(); return false; }
	if (email.value != cemail.value) { alert("Email confirmation failed."); cemail.focus(); return false; }
    }

    return true;
}

function checkEmail(email) {
    var myRegExp = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
    return myRegExp.test(email);
}

// Check google search form

function checkChoise() {
	if (document.getElementById("fulltxt").checked) {
		window.location.href = "http://www2.us.elsevierhealth.com/inst/serve?action=searchform&id=jem";
		return false;
	} else if (document.getElementById("q").value.length == 0) {
		return false;
	}
	return true;
}

//-->