function openPopUpAndTrack (trackID, sUrl, nWidth, nHeight) {
	window.open(sUrl,'pirates','scrollbars=yes,resizable=yes,width=' + nWidth + ',height=' + nHeight + '');
	_hbflash(trackID,'n','n','n');
}


function linkTo(url){
alert('linkTo : ' + url);
//	document.window.location = url;
}

function launchPromoLinkPlease(loc){
	document.location.href = loc;
}

// JavaScript Document
//generic pop up
function launchWindow(loc,w,h){
	var id = Math.round(Math.random()*1000);
	var numW = Number(w);
	var numH = Number(h);
	window.open(loc, id,"width="+numW+", height="+numH+", left=100, top=100, scrollbars=yes, toolbar=no, location=no, status=no, menubar=no, resizable=yes");
}



/*    GET TRAILERS    */
function getTrailers() {
	var win = window.open(trailerPath, 'trailers', 'width=702, height=502');
	win.focus();
}
/*    GET GALLERY    */
function getGallery() {
	var win = window.open("gallery.html", 'icons', 'width=500, height=410');
	win.focus();	
}
/* open Screen SAver Popup */
function openScreensaver (os,cid){
	var win = window.open(cid+'/downloads/potc_screensaver_'+os+'.html', 'screensavers', 'width=396, height=465');
	win.focus();
}
//
/*    GET AIM ICONS   */
function getAIMIcons (aimID, cid) {
	var iconName = getIconName (aimID);
	var win = window.open(cid+'/downloads/potc_icon.html?'+iconName, 'icons', 'width=396, height=485');
	win.focus();
}


/*    GET WALLPAPERS  */
function getWallpaper (wpID, wpSize, cid) {
	if(!cid){
		cid = "uk";
	}
    var wpName = getWpName (wpID);
	formatString = "potc2_"+wpName+"_"+wpSize+".jpg";
    path = "desktops/"+ wpName + "/" + formatString;
    var winl = ((screen.width)/2);
    var wint = ((screen.height)/2)-20;
    if (winl < 0) winl = 0;
    if (wint < 0) wint = 0;
    //var settings = 'scrollbars=1&resize=1';
    win = window.open(cid+"/downloads/displayWP.html?"+path);
	win.focus();
}
//
function  getIconName (iconID) {
	switch (iconID) {
	  case 1:
	  return "jack";
  	  break;
	  
	  case 2:
	  return "elizabeth";
	  break;
	  
	  case 3:
	  return "will";
	  break;
	  
	  case 4:
	  return "davyJones";
	  break;
	  
	  case 5:
	  return "skull";
	  break;
	};
}

//
function  getWpName (wpID) {
	switch (wpID) {
	  case 1:
	  return "jack";
  	  break;
	  
	  case 2:
	  return "will";
	  break;
	  
	  case 3:
	  return "group";
	  break;
	  
	  case 4:
	  return "elizabeth";
	  break;
	  
	  case 5:
	  return "davyJones";
	  break;
	  
	  case 6:
	  return "jackKing";
	  break;
	  
	}
}
