function confirmation(msg){
	var agree = confirm(msg);
	if(agree){
		return true;
	}else{
		return false;
	}
}
function ViewImage(ifile,ix,iy,ititle) { 
var win;
var sWidth;
var sHeight;
var NS = (document.layers) ? 1 : 0;
win = window.open("","imageviewer","width="+ix+",height="+iy+",menubar=no,toolbar=no");
if (NS) {
sWidth = win.innerWidth;
sHeight = win.innerHeight;
} else {
sWidth = win.document.body.clientWidth;
sHeight = win.document.body.clientHeight;
}
if(sWidth!=ix || sHeight!=iy) {
win.close();
setTimeout("ViewImage('"+ifile+"',"+ix+","+iy+",'"+ititle+"')", 250);
return;
}
win.document.open();
win.document.write("<html><head><title>"+ititle+"</title>");
win.document.write("</head><body>");
win.document.write('<div style="position:absolute;width:'+ix+'px;height:'+iy+'px;left:0px;top:0px">');
win.document.write("<img src="+ifile+"></div></body></html>");
win.document.close();
}

function onPnlFavorite(){
	document.getElementById("pnlFavorite").innerHTML = "<table cellpadding='1' cellspacing='0' width='100%' bgcolor='#FFCC99'><tr valign='left'><td width='30%'><b>Add to favorites?</b></td><td width='40%' align ='left'><b>YES</b><input type='radio' id='radFavorite' name='radFavorite' value='1' checked/>&nbsp;&nbsp;<b>NO</b><input type='radio' id='radFavorite' name='radFavorite' value='0'/></td><td width='20%'>&nbsp;</td></tr>";
}

function offPnlFavorite(){
	document.getElementById("pnlFavorite").innerHTML = "";
}

function validateRating(){
	if(document.forms[0].rating_id.checked == false){
		alert("Not checked");
		return false;
	}
}

// usage:  onKeyPress='return Numeric(event)'
function Numeric(p_event)
{
        var key;
        var keychar;

        if (window.event)
                key = window.event.keyCode;
        else if (p_event)
                key = p_event.which;
        else
                return true;
        keychar = String.fromCharCode(key);

        // control keys
        if ((key==null) || (key==0) || (key==8) ||(key==9) || (key==13) || (key==27) )
                return true;
        else if ((("0123456789. ").indexOf(keychar) > -1))
                return true;
        else
                return false;
}