<!--

var overImg = null;
var normImg = null;

var loadDone = false;


////////////////////////////////////////////////////////////////////////
/* bookmark function for numeruos browsers  */

function bookmarkinit() {
var IE = navigator.appName.match(/(Microsoft Internet Explorer)/gi), 
    NS = navigator.appName.match(/(Netscape)/gi), 
    OP = navigator.appName.match(/(Opera)/gi), 
    BK = document.getElementById("bookmark");



    BK.onmouseout = function(){ 
       window.status = ''; 
       return true; 
    } 

    if(IE && document.uniqueID){ 
       BK.onclick = function(){ 
          window.external.AddFavorite(location.href,document.title); 
       } 
       BK.onmouseover = function(){ 
          window.status='Click to add this page to your '+RegExp.$1+' favorites'; 
          return true; 
       } 
    } 

    else if(OP || IE && !document.uniqueID){ 
       BK.onclick = function(){ 
          alert('Your '+RegExp.$1+' browser requires that you\nPress Ctrl & T to Bookmark this page.'); 
       } 
       BK.onmouseover = function(){ 
          window.status='Your '+RegExp.$1+' browser requires that you Press Ctrl & T to Bookmark this page.'; 
          return true; 
       } 
    } 

    else if(NS){ 
       BK.onclick = function(){ 
          alert('Your '+RegExp.$1+' browser requires that you\nPress Ctrl & D to Bookmark this page.'); 
       } 
       BK.onmouseover = function(){ 
          window.status='Your '+RegExp.$1+' browser requires that you press Ctrl & D to Bookmark this page.'; 
          return true; 
       } 
    } 

    else{ BK.innerHTML = '' }

}

///////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////

/* function for body.onLoad */

function initPage() {
	preloadMenu(8);
	loadDone = true;
}

////////////////////////////////////////////////////////////////////////

/* functions for menu and other images */
function preloadMenu(count) {
	overImg = new preloadImages(count, "/data/images/design/menu/menu-", "-on.gif");
	normImg = new preloadImages(count, "/data/images/design/menu/menu-", "-off.gif");
}

function preloadImages(length, path, type) {
    for(var i = 2; i <= length; i++) {
	this[i]= new Image();
	this[i].src= path + i + type;
    }
    return this;
}

function rollOn(num) {
    if(loadDone && document.images) { 
	document.images["m-" + num].src = overImg[num].src;
    }
}

function rollOff(num) {
    if(loadDone && document.images){
	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 = 650,
        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 SpreadTheWord(url) {
    var width = 700,
        height = 600;

    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+", menubar=no, status=no, resizable=no, toolbar=no, scrollbars=no");

    if (remote.opener == null) remote.opener = window;
}

function doOpenWindow(url) {
    var width = 500,
        height = 530;

    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+", menubar=no, status=no, resizable=no, toolbar=no, scrollbars=no");

    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);
	/*return "firefighternearmiss.demo.ivelum.com";*/
}

/* 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;
}

////////////////////////////////////////////////////////////////////////

/* functions that check different forms for correct information */










var hwnd = null;

function doFormVote(url, flag) {

    var ans_index = checkVoteForm();
    
    if (ans_index < 0 && !flag) { return; }

    var vform = document.fpoll;
    var url_vars = 	"?poll_id=" + vform.poll_id.value +
    								"&ans=" + (ans_index + 1);
    if (hwnd == null || (hwnd != null && hwnd.closed)) {
	hwnd = showWindow(url + url_vars);
    } 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;
}

function checkVoteForm() {
 
  var vform = document.fpoll;
    for (var i = 0; i < vform.ans.length; i++) {
	if (vform.ans[i].checked) { return i; }
    }
    return -1;
}








//-->
