// Global js functions & objects


var oldhlStyle = "";
var nn=(document.layers)?true:false; 
var ie=(document.all)?true:false;
var saleRatings =  ['Dybt kritisabelt', 'Dårligt', 'Acceptabelt', 'Godt', 'Fantastisk'];

 
function hl(row, style) 
{
	if (typeof(row.style) == 'undefined' || typeof(row.cells) == 'undefined') 
	{
		return false;
	}
	
	if (style.length > 0)
	{
		oldhlStyle = row.className;
		row.className = style;
	}
	else
		row.className = oldhlStyle;	
}


function showProfilePic(imgName, userName)
{
    window.open("/pages/popup/showprofilepic.jsp?imgname=" + imgName+ "&uname=" + userName,
                "", "resizable=yes,scrollbars=yes,toolbar=no,location=no,width=500,height=500");
}


function composeMail(recipientId, recipientName)
{
	window.open("/pages/message/composemail.jsp?recipientid=" + recipientId + "&recipientname=" + recipientName,
				"", "toolbar=no,location=no,scrollbars=yes,resizable=yes,width=700,height=480");
}


function openFAQ()
{
	window.open("/pages/popup/help/faq.jsp#oftenusedhtml",
				"", "toolbar=no,scrollbars=yes, resizable=yes,location=no,width=900,height=700");
}


function guestbookReply(toId, fromId, userName, parentId, convId) 
{
	win = window.open("/pages/guestbook/reply.jsp?toid=" + toId + "&parentid=" + parentId + "&convid=" + convId + "&uid=" + fromId + "&uname=" + userName,
			"", "toolbar=no,location=no,width=" + 750 + ",height=" + 220 + ",top=300,left=300, resize=yes");
	win.focus();
}


function bmAlert(msg)
{
	alert(msg);	
}


function MM_preloadImages() 
{ 
	//v3.0

  	var d=document; 
  	if(d.images)
  	{ 
  		if(!d.MM_p) 
  			d.MM_p=new Array();
    	var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    	if (a[i].indexOf("#")!=0)
    	{ 
    		d.MM_p[j]=new Image; 
    		d.MM_p[j++].src=a[i];
    	}
    }
}




function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}



function showBusyOverlay(element)
{
	return getBusyOverlay(element,{color:'white', opacity:0.5, style:'font-weight:bold;font-size:10px;color:black', text:"Vent..."},{color:'#000000', size:30, type:'p'});	
}

function clearBusyOverlay(overlay)
{
	overlay.remove();
}


var preloadFlag = false;
function preloadImages() {
	if (document.images) {
		preloadFlag = true;
	}
}







	

