/* ******************************************************************* */
/*   UTIL FUNCTIONS                                                    */
/* ******************************************************************* */



/* ===========================================================================
 *
 * JQuery URL Parser
 * Version 1.0
 * Parses URLs and provides easy access to information within them.
 *
 * Author: Mark Perkins
 * Author email: mark@allmarkedup.com
 *
 * For full documentation and more go to http://projects.allmarkedup.com/jquery_url_parser/
 *
 * ---------------------------------------------------------------------------
 *
 * CREDITS:
 *
 * Parser based on the Regex-based URI parser by Steven Levithan.
 * For more information (including a detailed explaination of the differences
 * between the 'loose' and 'strict' pasing modes) visit http://blog.stevenlevithan.com/archives/parseuri
 *
 * ---------------------------------------------------------------------------
 *
 * LICENCE:
 *
 * Released under a MIT Licence. See licence.txt that should have been supplied with this file,
 * or visit http://projects.allmarkedup.com/jquery_url_parser/licence.txt
 *
 * ---------------------------------------------------------------------------
 * 
 * EXAMPLES OF USE:
 *
 * Get the domain name (host) from the current page URL
 * jQuery.url.attr("host")
 *
 * Get the query string value for 'item' for the current page
 * jQuery.url.param("item") // null if it doesn't exist
 *
 * Get the second segment of the URI of the current page
 * jQuery.url.segment(2) // null if it doesn't exist
 *
 * Get the protocol of a manually passed in URL
 * jQuery.url.setUrl("http://allmarkedup.com/").attr("protocol") // returns 'http'
 *
 */

jQuery.url = function()
{
	var segments = {};
	
	var parsed = {};
	
	/**
	 * Options object. Only the URI and strictMode values can be changed via the
	 * setters below.
	 */
  	var options = {
	
		url : window.location, // default URI is the page in which the script
								// is running
		
		strictMode: false, // 'loose' parsing by default
	
		key: ["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"], // keys
		q: {
			name: "queryKey",
			parser: /(?:^|&)([^&=]*)=?([^&]*)/g
		},
		parser: {
			strict: /^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,  
			// less intuitive,more
			loose:  /^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/ // more
		}
		
	};
	
    /**
	 * Deals with the parsing of the URI according to the regex above. Written
	 * by Steven Levithan - see credits at top.
	 */		
	var parseUri = function()
	{
		str = decodeURI( options.url );
		
		var m = options.parser[ options.strictMode ? "strict" : "loose" ].exec( str );
		var uri = {};
		var i = 14;

		while ( i-- ) {
			uri[ options.key[i] ] = m[i] || "";
		}

		uri[ options.q.name ] = {};
		uri[ options.key[12] ].replace( options.q.parser, function ( $0, $1, $2 ) {
			if ($1) {
				uri[options.q.name][$1] = $2;
			}
		});

		return uri;
	};

    /**
	 * Returns the value of the passed in key from the parsed URI.
	 * 
	 * @param string
	 *            key The key whose value is required
	 */		
	var key = function( key )
	{
		if ( ! parsed.length )
		{
			setUp(); // if the URI has not been parsed yet then do this
						// first...
		} 
		if ( key == "base" )
		{
			if ( parsed.port !== null && parsed.port !== "" )
			{
				return parsed.protocol+"://"+parsed.host+":"+parsed.port+"/";	
			}
			else
			{
				return parsed.protocol+"://"+parsed.host+"/";
			}
		}
	
		return ( parsed[key] === "" ) ? null : parsed[key];
	};
	
	/**
	 * Returns the value of the required query string parameter.
	 * 
	 * @param string
	 *            item The parameter whose value is required
	 */		
	var param = function( item )
	{
		if ( ! parsed.length )
		{
			setUp(); // if the URI has not been parsed yet then do this
						// first...
		}
		return ( parsed.queryKey[item] === null ) ? null : parsed.queryKey[item];
	};

    /**
	 * 'Constructor' (not really!) function. Called whenever the URI changes to
	 * kick off re-parsing of the URI and splitting it up into segments.
	 */	
	var setUp = function()
	{
		parsed = parseUri();
		
		getSegments();	
	};
	
    /**
	 * Splits up the body of the URI into segments (i.e. sections delimited by
	 * '/')
	 */
	var getSegments = function()
	{
		var p = parsed.path;
		segments = []; // clear out segments array
		segments = parsed.path.length == 1 ? {} : ( p.charAt( p.length - 1 ) == "/" ? p.substring( 1, p.length - 1 ) : path = p.substring( 1 ) ).split("/");
	};
	
	return {
		
	    /**
		 * Sets the parsing mode - either strict or loose. Set to loose by
		 * default.
		 * 
		 * @param string
		 *            mode The mode to set the parser to. Anything apart from a
		 *            value of 'strict' will set it to loose!
		 */
		setMode : function( mode )
		{
			strictMode = mode == "strict" ? true : false;
			return this;
		},
		
		/**
		 * Sets URI to parse if you don't want to to parse the current page's
		 * URI. Calling the function with no value for newUri resets it to the
		 * current page's URI.
		 * 
		 * @param string
		 *            newUri The URI to parse.
		 */		
		setUrl : function( newUri )
		{
			options.url = newUri === undefined ? window.location : newUri;
			setUp();
			return this;
		},		
		
		/**
		 * Returns the value of the specified URI segment. Segments are numbered
		 * from 1 to the number of segments. For example the URI
		 * http://test.com/about/company/ segment(1) would return 'about'.
		 * 
		 * If no integer is passed into the function it returns the number of
		 * segments in the URI.
		 * 
		 * @param int
		 *            pos The position of the segment to return. Can be empty.
		 */	
		segment : function( pos )
		{
			if ( ! parsed.length )
			{
				setUp(); // if the URI has not been parsed yet then do this
							// first...
			} 
			if ( pos === undefined )
			{
				return segments.length;
			}
			return ( segments[pos] === "" || segments[pos] === undefined ) ? null : segments[pos];
		},
		
		attr : key, // provides public access to private 'key' function - see
					// above
		
		param : param, // provides public access to private 'param' function -
						// see above
		getMediaUrlWithHost : function(action) 
		{
			/*
			 * if(action) return key("protocol")+"://"+
			 * key("host")+":8080/sis"+action; else return
			 * key("protocol")+"://"+ key("host")+":8080/sis";
			 */	
			/*if(action)
				return key("protocol")+"://"+key("host")+":8080/media1"+action;
				else
				return key("protocol")+"://"+key("host")+"8080/media1";*/
	  if(action) 
				  return key("protocol")+"://"+key("host")+action; 
			  else 
				  return key("protocol")+"://"+key("host");
		}
	};
	
}();

function seriesUrl(customerName,seriesName,type){
	var lurl = jQuery.url.getMediaUrlWithHost("/iuser/mediaIuser.do");
	var pars = "cn=" + customerName+"&sn=" + seriesName + "&type=" + type;
	$.ajax(
			{
				type:"POST", 
				url:lurl, 
				data:pars, 
				cache:true, 
				success:function (message) {
					$("#seriesList").html(message);
				}
			});
}

//==============================================MediaHome.jsp scripts=============================================
//AudioPlayer.setup("http://go.startthefusion.com/scripts/player/audio/player.swf", {width:585, initialvolume:100, transparentpagebg:"yes", left:"000000", lefticon:"FFFFFF"});
//AudioPlayer.setup("http://localhost:8080/media1/scripts/player/audio/player.swf", {width:585, initialvolume:100, transparentpagebg:"yes", left:"000000", lefticon:"FFFFFF"});
AudioPlayer.setup(jQuery.url.getMediaUrlWithHost("/scripts/player/audio/player.swf"), {width:585, initialvolume:100, transparentpagebg:"yes", left:"000000", lefticon:"FFFFFF"});
function writeNewVideo(embed) {
	height = 340;
	if (embed.match("<iframe") != null || embed.match("<object") != null) {
		document.getElementById("mainImageStream").innerHTML = embed;
	} else {
		var flashObject = "";
		if (embed.match("youtube") != null) {
			var videoId = embed.replace("http://gdata.youtube.com/feeds/api/videos/", "");
			flashObject = "<object height=\"340\" width=\"585\"  ><div><param name=\"movie\" value=\"http://www.youtube.com/v/" + videoId + "&hl=en&fs=1&\"></param><param name=\"allowFullScreen\" value=\"true\"></param><param name=\"allowscriptaccess\" value=\"always\"></param><embed height=\"340\" width=\"585\" src=\"http://www.youtube.com/v/" + videoId + "&hl=en&fs=1&\" type=\"application/x-shockwave-flash\" allowscriptaccess=\"always\" allowfullscreen=\"true\" width=\"425\" height=\"344\"></embed></object>";
		     //   flashObject='<embed height="340" width="585" flashvars="rv.2.thumbnailUrl=http%3A%2F%2Fi4.ytimg.com%2Fvi%2F7BrAmPLldvc%2Fdefault.jpg&amp;rv.7.length_seconds=25&amp;rv.0.url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D19524lR9xFk&amp;rv.0.view_count=220&amp;rv.2.title=Enthan+Vaanamum+Neethan+Vazhthugal+by+Director+Seeman&amp;rv.7.thumbnailUrl=http%3A%2F%2Fi3.ytimg.com%2Fvi%2FzSulZXMQnqc%2Fdefault.jpg&amp;rv.4.rating=5.0&amp;length_seconds=130&amp;rv.0.title=Keep+your+eyes+wide+open+as+what+happened+in+Sr+Lanka+terrorism+state&amp;rv.7.title=tamils+in+westminster+6&amp;rv.3.view_count=652&amp;rv.5.title=tamil+ellam+protest+bangalore+2&amp;is_doubleclick_tracked=1&amp;rv.4.thumbnailUrl=http%3A%2F%2Fi4.ytimg.com%2Fvi%2FCmYGvgyks3Y%2Fdefault.jpg&amp;fmt_url_map=34%7Chttp%3A%2F%2Fv16.lscache3.c.youtube.com%2Fvideoplayback%3Fip%3D0.0.0.0%26sparams%3Did%252Cexpire%252Cip%252Cipbits%252Citag%252Cburst%252Cfactor%26itag%3D34%26ipbits%3D0%26signature%3D2BE1FCA29636D6FF162B03A0E4CBC7CF8001E913.C5545B8D1A0EBE0979EBB0F0470BA6D4CFDF010A%26sver%3D3%26expire%3D1254434400%26key%3Dyt1%26factor%3D1.25%26burst%3D40%26id%3Db558ffc8bea6a91e%2C5%7Chttp%3A%2F%2Fv13.lscache2.c.youtube.com%2Fvideoplayback%3Fip%3D0.0.0.0%26sparams%3Did%252Cexpire%252Cip%252Cipbits%252Citag%252Cburst%252Cfactor%26itag%3D5%26ipbits%3D0%26signature%3D99A9258B6B35FB492B007447BE57A2D650E25DF7.B8D02F8D1F53EF2445E0D7B728A49862DCC00A80%26sver%3D3%26expire%3D1254434400%26key%3Dyt1%26factor%3D1.25%26burst%3D40%26id%3Db558ffc8bea6a91e&amp;rv.0.length_seconds=565&amp;rv.2.rating=5.0&amp;keywords=hognekkalWaterFall&amp;cr=US&amp;rv.1.url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DHJwHcslEzsk&amp;rv.6.thumbnailUrl=http%3A%2F%2Fi4.ytimg.com%2Fvi%2F3gXWMwMcjxw%2Fdefault.jpg&amp;rv.1.id=HJwHcslEzsk&amp;rv.3.rating=5.0&amp;rv.6.title=Hannover+Tamil+Pistas&amp;rv.7.id=zSulZXMQnqc&amp;rv.4.url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DCmYGvgyks3Y&amp;rv.1.title=Aedho+Saigirai+Vaamanan&amp;rv.1.thumbnailUrl=http%3A%2F%2Fi1.ytimg.com%2Fvi%2FHJwHcslEzsk%2Fdefault.jpg&amp;rv.3.title=%E0%AE%AA%E0%AE%BF%E0%AE%B0%E0%AE%AA%E0%AE%BE%E0%AE%95%E0%AE%B0%E0%AE%A9%E0%AF%8D+%E0%AE%A8%E0%AE%BF%E0%AE%A9%E0%AF%88%E0%AE%A4%E0%AF%8D%E0%AE%A4%E0%AE%A4%E0%AF%81+%E0%AE%A8%E0%AE%9F%E0%AE%95%E0%AF%8D%E0%AE%95%E0%AF%81%E0%AE%AE%E0%AF%8D&amp;rv.0.rating=5.0&amp;feature=youtube_gdata&amp;watermark=http%3A%2F%2Fs.ytimg.com%2Fyt%2Fswf%2Flogo-vfl106645.swf%2Chttp%3A%2F%2Fs.ytimg.com%2Fyt%2Fswf%2Fhdlogo-vfl100714.swf&amp;rv.6.author=scarface1952&amp;rv.5.id=0ANsU5PEQC0&amp;rv.4.author=rmwon&amp;rv.0.featured=1&amp;rv.0.id=19524lR9xFk&amp;rv.3.length_seconds=323&amp;rv.5.rating=5.0&amp;rv.1.view_count=4792&amp;sdetail=f%3Ayoutube_gdata%2Cp%3Agdata.youtube.&amp;rv.1.author=DiasporaTamils&amp;rv.1.rating=4.42857142857&amp;rv.4.title=tamil+ellam+protest+bangalore+1&amp;rv.5.thumbnailUrl=http%3A%2F%2Fi1.ytimg.com%2Fvi%2F0ANsU5PEQC0%2Fdefault.jpg&amp;rv.5.url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D0ANsU5PEQC0&amp;rv.6.length_seconds=55&amp;sourceid=r&amp;rv.0.author=singlahelgotoHel&amp;rv.3.thumbnailUrl=http%3A%2F%2Fi1.ytimg.com%2Fvi%2FxtjaPGmT_w4%2Fdefault.jpg&amp;rv.2.author=TamilDiaspora&amp;rv.6.url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D3gXWMwMcjxw&amp;rv.7.rating=0.0&amp;rv.3.url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DxtjaPGmT_w4&amp;fmt_map=34%2F0%2F9%2F0%2F115%2C5%2F0%2F7%2F0%2F0&amp;hl=en&amp;rv.7.url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DzSulZXMQnqc&amp;rv.2.view_count=625&amp;rv.4.length_seconds=565&amp;rv.4.view_count=31&amp;rv.2.url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D7BrAmPLldvc&amp;plid=AAR04OuLkKIKfpS7&amp;rv.5.length_seconds=572&amp;rv.0.thumbnailUrl=http%3A%2F%2Fi2.ytimg.com%2Fvi%2F19524lR9xFk%2Fdefault.jpg&amp;rv.7.author=kokulan241&amp;sk=MSpwVfQwcVUBliKynUNYkmvB9xAg7-p-C&amp;rv.5.view_count=41&amp;rv.1.length_seconds=265&amp;rv.6.rating=5.0&amp;rv.5.author=rmwon&amp;vq=medium&amp;rv.3.id=xtjaPGmT_w4&amp;rv.2.id=7BrAmPLldvc&amp;rv.2.length_seconds=251&amp;t=vjVQa1PpcFMLXET4xWu8HPuhMIaWzUNLPL6JcDfKwrM%3D&amp;rv.6.id=3gXWMwMcjxw&amp;video_id=';
		    	//flashObject=flashObject+videoId+'&amp;rv.6.view_count=252&amp;rv.3.author=Nerupinkural&amp;rv.4.id=CmYGvgyks3Y&amp;rv.7.view_count=27&amp;playnext=0&amp;enablejsapi=1" allowscriptaccess="always" allowfullscreen="true" quality="high" bgcolor="#000000" name="movie_player" id="movie_player" style="" src="http://s.ytimg.com/yt/swf/watch-vfl123151.swf" type="application/x-shockwave-flash"/>';
		} else {
			flashObject = "<object id=\"flvVideo\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0\" width=\"585\" height=\"" + height + "\" >" + "          <param name=\"movie\" value=\"" + embed + "\" />" + "          <param name=\"quality\" value=\"high\" />" + "        \t <param name=\"allowFullScreen\" value=\"true\" />" + "        \t <param name=\"menu\" value=\"false\">" + "          <param name=\"Flashvars\" value=\"autoStart=1\">" + "          <embed src=\"" + embed + "\" quality=\"high\" flashvars=\"autoStart=1\" allowFullScreen=\"true\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" width=\"585\" height=\"" + height + "\"></embed>" + "          </object>";
		}
		document.getElementById("mainImageStream").innerHTML = flashObject;
	}
	document.getElementById("mainImageStream").style.height = 340;
	document.getElementById("mainImageStream").style.width = 585;
	document.getElementById("audioPlayerDiv").innerHTML = "";
	document.getElementById("main").scrollIntoView();
}
function writeAudio(embed, imageLocation, seriesName) {
	var audioId = document.getElementById("audioplayer_1");
	if (audioId == null) {
		document.getElementById("audioPlayerDiv").innerHTML = "<div id=\"audioplayer_1\">\t</div>";
	}
	var audioURL=embed;
	if(embed.match('http://')==null){
		audioURL = jQuery.url.getMediaUrlWithHost('/'+embed);
	}
	if(imageLocation.match('http://')==null){
		imageLocation = jQuery.url.getMediaUrlWithHost(imageLocation);
	}
	/*for MediaFusion audio url :
	var audioURL = jQuery.url.getMediaUrlWithHost('/'+embed);
	*/	
	AudioPlayer.embed("audioplayer_1", {soundFile:audioURL, autostart:"yes"});
	writeMainImageWithAudio(imageLocation, seriesName);
}
function searchByKeyword() {
	var keyword = document.getElementById("searchString").value;
	var custId = document.getElementById("custId").value;
	var customerName = document.getElementById("customerName").value;
	var type = document.getElementById("playerType").value;
	var lurl = jQuery.url.getMediaUrlWithHost("/ajax/ajaxSearchMedia.do");
	var pars = "custId=" + custId+"&keyword=" + keyword + "&type=" + type;
	$.ajax(
				{
					type:"POST", 
					url:lurl, 
					data:pars, 
					cache:true, 
					success:function (message) {
						$("#searchMediaDiv").html(message);
					}
				});
}

function showMediaInfo(originalRequest) {
	$("searchMediaDiv").innerHTML = originalRequest.responseText;
}
function writeMainImage(image, altName) {
	var imageObject = "<img  src=\"" + image + "\" alt=\"" + altName + "\" style=\"height: 337px; width: 585px\" />";
	document.getElementById("mainImageStream").innerHTML = imageObject;
	document.getElementById("audioPlayerDiv").innerHTML = "";
}
function writeMainImageWithAudio(image, altName) {
	if(image == "")
	{
		image=jQuery.url.getMediaUrlWithHost("/images/media/no_image.jpg");
	}	
	var imageObject = "<img  src=\"" + image + "\" alt=\"" + altName + "\" style=\"height: 337px; width: 585px\"  class=\"corner iradius12\" align=\"absmiddle\"/>";
	document.getElementById("mainImageStream").innerHTML = imageObject;
}
function showHideSearchSeries(currentSeriesList, seriesList, image, altName) {
	document.getElementById("currentSeriesList").style.display = "none";
	document.getElementById("seriesList").style.display = "none";
	document.getElementById("seriesResponseList").style.display = "none";
	document.getElementById("audioPlayerDiv").innerHTML = "";
	document.getElementById("mainImageStream").innerHTML = "";
	writeMainImage(image, altName);
}
function showSeriesLessons(id, altName, lurl, cn) {
	document.getElementById("hideButtons").style.display = "block";
	document.getElementById("showButtons").style.display = "none";
	document.getElementById("seriesList").style.display = "none";
	document.getElementById("seriesResponseList").style.display = "block";
	document.getElementById("audioPlayerDiv").innerHTML = "";
	document.getElementById("mainImageStream").innerHTML = "";
	var pars = "sn=" + altName + "&cn=" + cn;
	$.ajax(
		{
			type:"POST", 
			url: lurl,   
			data: pars, 
			cache:false, 
			success:function (message) {
				$("#seriesResponseList").html(message);
				writeMainImage(image, altName);
			}});
	image = document.getElementById("seriesImageDisplay").innerHTML;
	writeMainImage(image, altName);
}
function showHideSermon(id, image, altName) {
	showHideAdminSermon(id);
	showHide("pod" + id);
	writeMainImage(image, altName);
}
function showHideAdminSermon(element) {
	var objChange = document.getElementById(element).style.display;
	if (objChange == "none") {
		document.getElementById(element).style.display = "block";
		document.getElementById(element).scrollIntoView();
	} else {
		document.getElementById(element).style.display = "none";
	}
}
var goto_top_type = -1;
var goto_top_itv = 0;
function goto_top_timer() {
	var y = goto_top_type == 1 ? document.documentElement.scrollTop : document.body.scrollTop;
	var moveby = 15; // set this to control scroll seed. minimum is fast
	y -= Math.ceil(y * moveby / 100);
	if (y < 0) {
		y = 0;
	}
	if (goto_top_type == 1) {
		document.documentElement.scrollTop = y;
	} else {
		document.body.scrollTop = y;
	}
	if (y == 0) {
		clearInterval(goto_top_itv);
		goto_top_itv = 0;
	}
}
function goto_top() {
	if (goto_top_itv == 0) {
		if (document.documentElement && document.documentElement.scrollTop) {
			goto_top_type = 1;
		} else {
			if (document.body && document.body.scrollTop) {
				goto_top_type = 2;
			} else {
				goto_top_type = 0;
			}
		}
		if (goto_top_type > 0) {
			goto_top_itv = setInterval("goto_top_timer()", 50);
		}
	}
}
function showHide(element) {
	var objChange = document.getElementById(element).style.display;
	if (objChange == "none") {
		document.getElementById(element).style.display = "block";
		document.getElementById(element).scrollIntoView();
	} else {
		document.getElementById(element).style.display = "none";
	}
}
function removeHTMLTags(strInputCode) {
	if (strInputCode) {
		strInputCode = strInputCode.replace(/&(lt|gt);/g, function (strMatch, p1) {
			return (p1 == "lt") ? "<" : ">";
		});
		var strTagStrippedText = strInputCode.replace(/<\/?[^>]+(>|$)/g, "");
		return strTagStrippedText;
	}
}

//====================================================End of MediaHome.jsp Scripts===============================

//====================================================UserDecorator scripts=======================================
function embedVideo(video) {
	document.getElementById("audioPlayerDiv").innerHTML = "";
	document.getElementById("mainImageStream").innerHTML = "<div style=\"margin:0px 0px 0px 4px\">" + unescape(video.html) + "</div>";
}
		
		// This function loads the data from Vimeo
function init(clipUrl) {
			// This is the oEmbed endpoint for Vimeo (we're using JSON)
			// (Vimeo also supports oEmbed discovery. See the PHP example.)
       	var endpoint = "http://vimeo.com/api/oembed.json";
        var url = endpoint + "?url=" + encodeURIComponent(clipUrl) + "&callback=embedVideo&height=350&width=580";
	var js = document.createElement("script");
	js.setAttribute("type", "text/javascript");
	js.setAttribute("src", url);
	document.getElementsByTagName("head").item(0).appendChild(js);
	document.getElementById("audioPlayerDiv").innerHTML = "";
}
function onClickSpan(id) {
	var spanID = $("span.editName" + id);
	spanID.hide();
	spanID.next("input#newSeq" + id).show().focus();
}

function launchvideo() {
	window.open("new-player.html", "Video Player", "width=880,height=560,top=100,left=100,resizeable=no,scrollbars=no,menubar=no,toolbar=no,status=yes,location=1, directories=no");
}
function isMaxLength(obj) {
	var mlength = obj.getAttribute ? parseInt(obj.getAttribute("maxlength")) : "";
	if (obj.getAttribute && obj.value.length > mlength) {
		obj.value = obj.value.substring(0, mlength);
	}
}	
//====================================End of UserDecorator scripts=======================================================


