function launchclip()
{	
	var argv = launchclip.arguments;
	var argc = argv.length;
	
	if (argc <= 2)
	{
		clipId = argv[0];
		channel = argv[1];
		var url="http://video.myway.com/sites/myway/popup2.asp?clipid="+clipId+"&channel="+channel;
		var player = window.open(url,"popupPlayer", "width=400,height=560");
	}
	else
	{
		uid = argv[0];
		template = argv[1];
		channel = argv[2];
		title = argv[3];
		width = argv[4];
		height = argv[5];
		custom = argv[6];
		scrollbar = argv[7];

		var ref = window.location.href;
		var baseURL = "player.video.myway.com";
		var	templatetype="popup";
		
		if(ref.indexOf("?") != -1) 
		{
			var qloc = ref.indexOf("?")
			ref = ref.substring(0,qloc)
		}
		
		if (channel=="") 
		 channel=0;
		if (!width)
			width=400;
		if (!height)
			height=600;
		if (!channel)
			channel=0
		if (!title)
			title=0
		if (!custom)
			custom='0'
		if (scrollbar!=0)
			scrollbar=1
				
		if (!uid)
		{
			alert("Sorry, invalid parameters specified. Cannot load clip.")
			return
		}
		else
		{
			newloc="http://"+baseURL+"/mm4/templates/viewer.asp?uid="+uid+"&templateid="+template+"&channel="+channel+"&id="+title+"&templatetype="+templatetype+"&customid="+custom+"&hsrc="+ref
			window.open(newloc,"popup","width="+width+",height="+height+",location=no,toolbar=no,menubar=no,scrollbars="+scrollbar)
		}
	}
}