function pop(sID) {
	var trackID = "";
	var theURL = "";
	switch (sID) {
		case "icons":
			trackID = "section_downloads_icons"
			theURL = cid + "/icons.html";
			popUpAndTrack(trackID,theURL,380,500);
		break;
		case "wallpaper":
			var id = pop.arguments [1]
			var width = pop.arguments [2];
			var height = 0;
			switch (width) {
				case 1920:
				case "1920":
					height=1200;
				break;
				case 1600:
				case "1600":
					height=1200;
				break;
				case 1280:
				case "1280":
					height=1024;
				break;
				case 1024:
				case "1024":
					height=768;
				break;
				case 800:
				case "800":
				default:
					width=800;
					height=600;
				break;
			}
			var margin = 14;
			var newWidth = Number(width) + (margin * 2) < screen.width ? Number(width) + (margin * 2) : screen.width;
			var newHeight = height + 164 < screen.height ? height + 164 : screen.height;
			theURL = cid + '/wallpaper.html?id=' +id + '&width=' + width +"&height=" + height;
			trackID = "section_downloads_wallpaper_" + id + "_" + width + "x" + height;
		//	alert("trackID = " + trackID + "\ntheURL=" + theURL)
			popUpAndTrack(trackID, theURL, newWidth, newHeight);
		break;
	}
}

function simpleTrack (sID) {
	//alert("simpleTrack: " + sID);
	cto.initFlashPV();
	cto.pageName=sID;
	cto.siteSection=ctoMap;	
	cto.trackFlashPV();
}

function popUpAndTrack (sID, sURL, nWidth, nHeight, sType) {
	setTimeout("openWindow('" + sURL + "','" + nWidth + "','" + nHeight + "','" + sType + "')", 500);
	simpleTrack(sID);
}

function navigateToUrl(sURL){
	window.open(sURL,"project_window","width=800,height=600");
}
function openWindow(sUrl, nWidth, nHeight, sType){
	// and the opening of the link
	if(sType == "self"){
		document.location = sUrl;
	}else{
		window.open(sUrl,"project_window",'scrollbars=1,resizable=1,width=' + nWidth + ',height=' + nHeight + '');
	}
}



