jQuery(function() {

	jQuery('a.swapvideo').live('click', function() {
												 
		var id=jQuery(this).attr('rel');
		var html=swapVideo(id);
		
		jQuery('#video_wrapper').children().remove();
		jQuery('#video_wrapper').append(html)
		
		return false;
												
	});

});


function swapVideo(id) {
	var html='			<div id="mediaplayer" style="width:360px; height:249px; margin-top:10px;"></div>';
		html+='			<script type="text/javascript">';
		html+='				var so = new SWFObject (streamPath, "video", "100%", "100%", "9", "#000000");';
		html+='				so.addParam("allowScriptAccess", "always");';
		html+='				so.addParam("wmode", "opaque");';
		html+='				so.addParam("allowFullScreen", "true");';
		html+='				so.addVariable("playerId", "nlsingle");';
		html+='				so.addVariable("referralParentPlaylistId", "null" );';
		html+='				so.addVariable("referralPlaylistId", "null");';
		html+='				so.addVariable("referralObject","'+id+'");';
		html+='				so.useExpressInstall("swfobject/expressinstall.swf");';
		html+='				so.write("mediaplayer");';
		html+='			</script>';
		
		return html;
}

function toggleVisibility (obj, type) {
     var obj = document.getElementById(obj);
	switch(obj.className) {
     case 'hide':
		obj.className = 'reveal';
     	break;
	default:
     	obj.className = 'hide';
	}
}

function OpenBrWindow(theURL,winName,features, myWidth, myHeight, isCenter) { //v3.0
  if(window.screen)if(isCenter)if(isCenter=="true"){
    var myLeft = (screen.width-myWidth)/2;
    var myTop = (screen.height-myHeight)/2;
    features+=(features!='')?',':'';
    features+=',left='+myLeft+',top='+myTop;
  }
  window.open(theURL,winName,features+((features!='')?',':'')+'width='+myWidth+',height='+myHeight);
}