function getQueryParam(name) {
  var queryString = document.location.search.substring(1);
  var pairs = queryString.split("&");
  var pair;
  var guid = 0;

  for (var i = 0; i > pairs.length; i++) {
	pair = pairs[i].split("=");
	if (pair[0] == name)
	  return pair[1];
  }
}

guid = getQueryParam("guid");

function init()
{

	Msn.Video.createWidget('CustomPlayer1Container',
					  'CustomPlayer', 797, 930,
					  getOptions(guid),
					  'CustomPlayer1');
}

window.onload = init;
					  

function getOptions(guid) {
  var options =     {
					  "configCsid": "AU_ninemsn",
					  "configName": "cosmo_expanded_player",
					  "cssString": getCSSString()
					};

					if (!guid == 0) {
					  options["metadataLarge.defaultVidId"] = guid;
					  options["metadataLarge.isPlaylist"] = "true";
					}
  return options;
}

function getCSSString() {
  return "  #gallery .tabSelected\
										{\
											height: 24px;\
											border-bottom-width: 0px;\
											border-color: #929091;\
											font-size: 12px;\
											background-color: #ffffff;\
											padding-left: 7px;\
											border-width: 1px;\
											padding-right: 7px;\
											color: #929091;\
										}\
										#gallery .galleryContentsTabbed\
										{\
										  width: *;\
										  background-color: #ffffffff;\
										  border-color: #929091;\
										  border-width: 1px;\
										  padding-right: 3px;\
										  border-top-width: 0px;\
										  height: *;\
										}\
										.searchBoxButton\
										{\
										  background-color: #f52a7b;\
										  font-size: 12px;\
										  padding-left: 3px;\
										  color: #ffffff;\
										  cursor: pointer;\
										  padding-right: 3px;\
										  height: *;\
										}\
										#gallery .tab\
										{\
											background-color: #929091;\
											background-gradient-alpha: 0.4 0.1;\
											background-gradient-ratio: 180 255;\
											font-size: 12px;\
											background-gradient-rotation: 90;\
											border-bottom-color: #a5aaa5;\
											vertical-align: bottom;\
											cursor: pointer;\
											padding-left: 7px;\
											color: #ffffff;\
											border-bottom-width: 1px;\
											padding-right: 7px;\
											height: 22px;\
										}\
										#gallery .pagingButtonSelected\
										{\
										  color: #f52a7b;\
										  cursor: auto;\
										  font-weight: bold;\
										 }\
										 #gallery .gridVideoControlTitle\
										 {\
											width: *;\
											word-wrap: true;\
											color: #3e3e3e;\
											font-size: 11px;\
											max-height: 32px;\
										 }\
										 #gallery .videoControlSource\
										 {\
											width: *;\
											color: #f52a7b;\
											font-size: 11px;\
										 }\
										 #gallery .tabBarSpacerMiddle\
										 {\
											border-bottom-color: #929091;\
											width: 2px;\
											border-bottom-width: 1px;\
											height: *;\
										 }\
										 #metadataLarge .tabSelected\
										 {\
											border-color: #a5aaa5;\
											color: #f52a7b;\
											border-bottom-width: 0px;\
											padding-left: 7px;\
											font-size: 12px;\
											border-width: 1px;\
											padding-right: 7px;\
											height: 24px;\
										 }\
										 #metadataLarge .tab\
										 {\
											background-color: #f52a7b;\
											padding-right: 7px;\
											background-gradient-alpha: 0.4 0.1;\
											background-gradient-ratio: 180 255;\
											font-size: 12px;\
											background-gradient-rotation: 90;\
											border-bottom-color: #a5aaa5;\
											vertical-align: bottom;\
											border-bottom-width: 1px;\
											padding-left: 7px;\
											color: #ffffff;\
											cursor: pointer;\
											height: 22px;\
										 }\
										 #metadataLarge .pagingButtonSelected\
										 {\
											color: #f52a7b;\
											cursor: auto;\
											font-weight: bold;\
										 }\
										 #metadataLarge .videoControlTitle\
										 {\
											font-size: 12px;\
											width: *;\
											word-wrap: true;\
											color: #f52a7b;\
											max-height: 40px;\
											font-weight: bold;\
										 }\
										 #metadataLarge .videoControlSource\
										 {\
											width: *;\
											color: #3e3e3e;\
										 }\
										 #metadataLarge .tabBarSpacerMiddle\
										 {\
											height: *;\
											border-bottom-width: 1px;\
											width: 2px;\
											border-bottom-color: #929091;\
										 }\
										 #metadataLarge .scrollSliderVertical\
										 {\
											height: 40px;\
											border-width: 1px;\
											border-color: #f52a7b;\
											background-color: #f52a7b;\
											left: 0px;\
											margin: 2px;\
											top: 14px;\
											cursor: pointer;\
											right: 0px;\
										  }\
										  #metadataLarge .scrollSlideAreaVertical\
										  {\
											border-width: 1px;\
											border-color: #cccccc;\
											background-color: #e6e6e6;\
											bottom: 14px;\
											top: 14px;\
											left: 0px;\
											right: 0px;\
										  }\
										  #metadataLarge .detailVideoControlPlaying\
										  {\
											padding-left: 7px;\
											height: 70px;\
											margin-bottom: 2px;\
											overflow: hidden;\
											background-color: #e6e6e6;\
											padding-top: 3px;\
											padding-bottom: 3px;\
											margin-right: 7px;\
											margin-top: 3px;\
										  }\
										  #customPlayer .metadataSmall\
										  {\
											height: 100px;\
											width: *;\
											background-color: #e6e6e6;\
											border-top-color: #464646d8;\
											border-top-width: 0px;\
										  }\
										  #metadataSmall .infoPaneTitleCP\
										  {\
											font-weight: bold;\
											width: *;\
											font-size: 13px;\
											color: #f52a7b;\
										  }\
										  #metadataLarge .detailVideoControl:hover\
										  {\
											background-color: #e6e6e6;\
										  }\
										  #metadataSmall .infoPaneDescriptionCP\
										  {\
											word-wrap: true;\
											height: *;\
											width: *;\
											font-size: 11px;\
											color: #3e3e3e;\
										  }\
										  #metadataSmall .infoPaneFooterCP\
										  {\
											 display:none;\
										  }";

}