﻿function openBigPicture(p_ImgSource,p_width, p_height, p_name){
	var winl;
	var wint;
	
	if(screen.width){
		winl = (screen.width-p_width)/2;
		wint = (screen.height-p_height)/2;
	}
	else{winl = 0;wint =0;}
	
	var strFeatures;
	strFeatures = "status=no,toolbar=no,menubar=no,location=no,scrollbars=no,resizable=no,width="+p_width+",height="+p_height+",top="+wint+",left="+winl+"";
	oWindow = window.open('',p_name, strFeatures);
	oWindow.document.open();  
	oWindow.document.write('<style> body{margin:0;} </style>');
	oWindow.document.write('<a href="JavaScript:window.close();"><img src="'+p_ImgSource+'" width='+p_width+' height='+p_height+' border="0"></a>'); 
	oWindow.document.close();
	oWindow.focus();
}

function PF(p_ImgSource,p_width, p_height, p_name){
    var winl;
	var wint;
		
	if(screen.width){
		winl = (screen.width-p_width)/2;
		wint = (screen.height-p_height)/2;
	}
	else{winl = 0;wint =0;}
  
  var strFeatures;
  strFeatures = "status=no,toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=no,width=" + p_width + ",height=" + p_height+",top="+wint+",left="+winl+"";
  oWindow = window.open(p_ImgSource, p_name, strFeatures);
  oWindow.focus();			
}

function openPopup(p_strPage, name){
  var strFeatures;
  var p_strPage;
  strFeatures = "status=no,toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=no,width=417,height=400";
  oWindow = window.open(p_strPage, name, strFeatures);
  oWindow.focus();
}

function writeRatings(rating, width, starSize, imagePath)
{
    var divRatings = "";
    var background = "";
    var foreground = "";
    var foregroundWidth = "";
    
    if (starSize == "1")
    {
        background = "icon_stars_none_small.gif";
        foreground = "icon_stars_gold_small.gif";
    }
    if (starSize == "2")
    {
        background = "icon_stars_none.gif";
        foreground = "icon_stars_gold.gif";
    }
    
    foregroundWidth = Math.round((parseFloat(width) * parseFloat(rating)) / parseFloat(5.00));
    
    divRatings = "<div style='width:" + width + "px; background: url(" + imagePath + "/" + background + ") top left no-repeat;'><div style='width:" + foregroundWidth + "px;overflow:hidden;'><img src='" + imagePath + "/" + foreground + "' title='Rating' alt='Rating' style='margin:0;padding:0;' /></div></div>";
    
    document.write(divRatings);
}

function submitForm(form, action)
{
    document.forms[form].hdnAction.value = action;
}
