//This function is the network wide popup window handler for windows media and vote
function launch_popup() {
var arrArgs = launch_popup.arguments;
var winPopUp;
var strParam;
if (arrArgs.length == 2) {
   var strType = arrArgs[0];
   if (strType.toLowerCase() == 'media') {
      winPopUp = window.open('/mediapopup.aspx?'+arrArgs[1],'media_pop','height=470,width=690,channelmode=0,dependent=0,directories=0,fullscreen=0,location=0,menubar=0,resizable=0,scrollbars=0,status=1,toolbar=0');
   }
   else if (strType.toLowerCase() == 'vote') {
         winPopUp = window.open('/vote.aspx?voteID='+arrArgs[1],'_blank','resizable=0,menubar=0,scrollbars=0,status=0,toolbar=0,width=300,height=300');
}
   }
   else if (arrArgs.length == 5 || arrArgs.length == 4) {
      strParam = 'width=' + arrArgs[2] + ',height=' + arrArgs[3]
         if (arrArgs.length == 5) {
           strParam += ',' + arrArgs[4];
         }
         winPopUp = window.open(arrArgs[0],arrArgs[1],strParam);
     }
    return false;
}


//This function encodes the input URL context and returns it
function encodeURL(str)
{		
	if (encodeURIComponent) {	
		str = encodeURIComponent(str);
	} else {
	 	str = escape(str);
	 	str = str.replace(/:/g, "%3A").replace(/ /g, "%20").replace(/-/g,"%2D").replace(/_/g,"%5F").replace(/\./g, "%2E").replace(/\//g, "%2F").replace(/\?/g,"%3F").replace(/=/g,"%3D").replace(/&/g,"%26").replace(/\+/g,"%2B").replace(/\|/g,"%A6").replace(/\|/g,"%7C").replace(/,/g,"%2C");			
	}
	return str;
}

