// is mac IE?
MacIE = (navigator.userAgent.indexOf('MSIE') > -1 && navigator.userAgent.indexOf('Mac') > -1) ? ( true ) : ( false );

// types
var CLIP_TYPE_ANIMATION 	= "0";
var CLIP_TYPE_JPEG 			= "1";
var CLIP_TYPE_MOVIE			= "2";
var CLIP_TYPE_PANORAMA		= "3";
var CLIP_TYPE_AUDIO			= "4";
var CLIP_TYPE_MAP			= "5";

var IMAGE_PATH = "images";
if (depth=1){
	IMAGE_PATH = "../images";
}

function clip_getClip(
	withClip,
	withClipWidth,
	withClipHeight ){
	
	var strResult = "";
	var strLink = clip_getPopUpClipLink(CLIP_TYPE_JPEG, "", "", withClip, withClipWidth, withClipHeight);
	
	strResult += strLink;
	strResult += "<img src='"+IMAGE_PATH+"/award_thumbs/" + withClip +"' border=1 style='border-color:white'>";
	strResult += "</a>";
	;
	
	return strResult;
	
}

// clip_getPopUpClipLink
function clip_getPopUpClipLink(withClipType, withClipTitle, withClipCaption, withClip, withClipWidth, withClipHeight){
	
	return eval(new String("<a href=\"javascript:clip_popUpClip(\'" + withClipType + "\', \'"+ withClipTitle +"\', \'"+ withClipCaption +"\', \'"+ withClip +"\', \'"+ withClipWidth +"\', \'"+withClipHeight+"\', 'true')\"   onMouseover=\"showTip('<img src=&quot;"+IMAGE_PATH+"/award_rollovers/"+withClip+"&quot;>')\"; onMouseout=\"hideTip()\" class='tooltip'>"));
}


// clip_getClipTypeImage
function clip_getClipTypeImage(withClipType){
	var strIcon;
	
	// switch icons
	if (withClipType == CLIP_TYPE_JPEG){
		strIcon = "/images/icon_camera.gif";
	} else if(withClipType == CLIP_TYPE_AUDIO){
		strIcon = "/images/icon_speaker.gif";
	} else if(withClipType == CLIP_TYPE_MOVIE){
		strIcon = "/images/icon_video.gif";
	} else if(withClipType == CLIP_TYPE_MAP){
		strIcon = "/images/icon_map.gif";
	}
	return strIcon;
}

// clip_popUpClip
function clip_popUpClip(withClipType, withClipTitle, withClipCaption, withClip, width, height, resizable){
  	
  	var windowWidth = eval(width) + 35;
  	var windowHeight = eval(height) + 65;
	var windowTitle = "Detail";
	if (withClipType == CLIP_TYPE_MAP) { windowTitle = "Map"; }
  	
	if (resizable == "true") {
  		imageWindow = window.open("", "Detail", "scrollbars=yes,resizable=yes,menubar=no,toolbar=no,width="+ windowWidth + ",height="+ windowHeight );
  	} else {
	  	imageWindow = window.open("", "Detail", "scrollbars=no,resizable=no,menubar=no,toolbar=no,width="+ windowWidth + ",height="+ windowHeight );
	}
	imageWindow.document.close(); //clears window contents
  	imageWindow.document.write("<HEAD><TITLE>"+windowTitle+"</TITLE></HEAD>");
  	imageWindow.document.write("<link rel=stylesheet type='text/css' href='/styles/default.css'>");
  	imageWindow.document.write("<body leftmargin=4 topmargin=4 marginwidth=4 marginheight=4 class='popup' onload='self.focus();'>");
  	
  	if (withClipTitle.length > 0){
		imageWindow.document.write("<table cellpadding=0 cellspacing=0><tr>");
		imageWindow.document.write("<td class='clip' width='100%'><b>"+ withClipTitle +"</b></td></tr>");
		if (withClipCaption.length > 0){
			imageWindow.document.write("<tr><td colspan=2 class='clip'>" +withClipCaption+"</td></tr>");
		}
		imageWindow.document.write("</table>");
		imageWindow.document.write("<img src='/images/spacer.gif' width='2' height='6'><br>");
  	}
	imageWindow.document.write("<center><BR><img src='"+IMAGE_PATH+"/award_images/" + withClip +"'></center>");
	imageWindow.document.write("</BODY></HTML>");
  	
}

// clip_popUpClipAudioVideo
function clip_popUpClipAudioVideo(withClip, width, height){
  	
  	var windowWidth = eval(width) + 45;
  	var windowHeight = eval(height) + 65;
  	
  	window.open(withClip, "AV", "scrollbars=yes,resizable=yes,menubar=no,toolbar=no,width="+ windowWidth + ",height="+ windowHeight );
  	
}
