$(document).ready(function () {
	$("#menu1").mouseover(function () {
		if ($(this).attr("src").indexOf('_on') == -1)
			$(this).attr("src", $(this).attr("src").replace('menu1_off', 'menu1_hov'));
	});
	$("#menu1").mouseout(function () {
		$(this).attr("src", $(this).attr("src").replace('menu1_hov', 'menu1_off'));
	});

	$("#menu2").mouseover(function () {
		if ($(this).attr("src").indexOf('_on') == -1)
			$(this).attr("src", $(this).attr("src").replace('menu2_off', 'menu2_hov'));
	});
	$("#menu2").mouseout(function () {
		$(this).attr("src", $(this).attr("src").replace('menu2_hov', 'menu2_off'));
	});

	$("#menu3").mouseover(function () {
		if ($(this).attr("src").indexOf('_on') == -1)
			$(this).attr("src", $(this).attr("src").replace('menu3_off', 'menu3_hov'));
	});
	$("#menu3").mouseout(function () {
		$(this).attr("src", $(this).attr("src").replace('menu3_hov', 'menu3_off'));
	});

	$("#menu4").mouseover(function () {
		if ($(this).attr("src").indexOf('_on') == -1)
			$(this).attr("src", $(this).attr("src").replace('menu4_off', 'menu4_hov'));
	});
	$("#menu4").mouseout(function () {
		$(this).attr("src", $(this).attr("src").replace('menu4_hov', 'menu4_off'));
	});

}); 

function ActiveMenu(img) 
{
	var src = img.toString();
	$("#" + src).attr("src", $("#" + src).attr("src").replace("_off", '_on'));
}

function Help(URL){w=600; h=500;window.open(URL, null, 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,left=20,top=20,width=' + w + ',height=' + h);}

function SwitchImage(val, link, image, title)
{
	document.getElementById(link).href = val.toString().replace("&","&amp;");
	document.getElementById(image).src = "thumb.ashx?q=100&w=252&i=" + val;
}

function hov(loc,cls){if(loc.className)loc.className=cls;}

function setFocus(obj)
{	
	document.getElementById(obj).focus();
	return false;
}

function OpenNew(strPage) 
{
	window.open(strPage,"","width=416,height=400,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,dependent=no,screenX=50,screenY=50,left=50,top=50");
}

function Print(strHide)
{
	x = document.getElementById(strHide);
	
	x.style.visibility="hidden";
	window.print();
	x .style.visibility="visible";
}

function avoidTags()
{
	if ((event.keyCode > 59) && (event.keyCode < 63))
	{
		event.returnValue = false;
	}
}

function Set_Cookie(name, value, expires, path, domain, secure) {
    // set time, it's in milliseconds
    var today = new Date();
    today.setTime(today.getTime());

    /*
    if the expires variable is set, make the correct 
    expires time, the current script below will set 
    it for x number of days, to make it for hours, 
    delete * 24, for minutes, delete * 60 * 24
    */
    if (expires) 
    {
        expires = expires * 1000 * 60 * 60 * 24 ;
    }
    var expires_date = new Date(today.getTime() + (expires));

    document.cookie = name + "=" + escape(value) +
        ((expires) ? ";expires=" + expires_date.toGMTString() : "") +
        ((path) ? ";path=" + path : "") +
        ((domain) ? ";domain=" + domain : "") +
        ((secure) ? ";secure" : "");
}

