	function fncExtractTypeAndId(strDiv,strInput){
	
		var strVideo 		= strInput;
		var strVideoId1		= "";
		var strVideoId2		= "";
	
		if( strInput.indexOf("<embed") > -1 || strInput.indexOf("<object") > -1 || strInput.indexOf("<script") > -1 ){ 
	
			$('#errorfldVideoLink').css('display','block');	
		
		} else {
		
			$('#errorfldVideoLink').css('display','none');	
	
			if( strInput.indexOf("youtube") > -1 ){
	
				var strType			= "youtube";
					
				var strSearch		= "/watch?v=";
				var intPos 			= strVideo.indexOf(strSearch);
				var strVideoId1 	= strVideo.substr(intPos+strSearch.length);

				strSearch			= "&";	
				
				if( strInput.indexOf(strSearch) > -1 ){
				
					intPos 				= strVideoId1.indexOf(strSearch);
					strVideoId1			= strVideoId1.substr(0,intPos);
				}
		
			} else if( strInput.indexOf("myvideo") > -1 ){
	
				var strType			= "myvideo";
					
				var strSearch		= "/watch/";
				var intPos 			= strVideo.indexOf(strSearch);
				var strVideoId1 	= strVideo.substr(intPos+strSearch.length);
						
			} else if( strInput.indexOf("myspace") > -1 ){
	
				var strType			= "myspace";
					
				var strSearch		= "videoid=";
				var intPos 			= strVideo.indexOf(strSearch);
				var strVideoId1 	= strVideo.substr(intPos+strSearch.length);
			
			} else if( strInput.indexOf("dailymotion") > -1 ){ 
	
				var strType			= "dailymotion";
					
				var strSearch		= "/video/";
				var intPos 			= strVideo.indexOf(strSearch);
				var strVideoId1 	= strVideo.substr(intPos+strSearch.length);
				
				strSearch			= "_";	
				intPos 				= strVideoId1.indexOf(strSearch);
				strVideoId1 		= strVideoId1.substr(0,intPos);
	
			} else if( strInput.indexOf("clipfish") > -1 ){
	
				var strType			= "clipfish";
					
				var strSearch		= "/video/";
				var intPos 			= strVideo.indexOf(strSearch);
				var strVideoId1 	= strVideo.substr(intPos+strSearch.length);
	
				strSearch			= "/";	
				intPos 				= strVideoId1.indexOf(strSearch);
				strVideoId1 		= strVideoId1.substr(0,intPos);
				
			} else if( strInput.indexOf("sevenload") > -1 ){
	
				var strType			= "sevenload";
					
				var strSearch		= "/videos/";
				var intPos 			= strVideo.indexOf(strSearch);
				var strVideoId1 	= strVideo.substr(intPos+strSearch.length);
	
				strSearch			= "-";	
				intPos 				= strVideoId1.indexOf(strSearch);
				strVideoId1 		= strVideoId1.substr(0,intPos);
				
			} else if( strInput.indexOf("metacafe") > -1 ){
	
				var strType			= "metacafe";
					
				var strSearch		= "/watch/";
				var intPos 			= strVideo.indexOf(strSearch);
				var strVideoId1 	= strVideo.substr(intPos+strSearch.length);
	
				if( strVideoId1.substr(strVideoId1.length-1) == "/"){
				
					strVideoId1 = strVideoId1.substr(0,strVideoId1.length-1);
				}
	
			} if( strInput.indexOf("vimeo") > -1 ){
	
				var strType			= "vimeo";
					
				var strSearch		= "vimeo.com/";
				var intPos 			= strVideo.indexOf(strSearch);
				var strVideoId1 	= strVideo.substr(intPos+strSearch.length);
						
			} else if( strInput.indexOf("yahoo") > -1 ){
	
				var strType			= "yahoo";
					
				var strSearch		= "/watch/";
				var intPos 			= strVideo.indexOf(strSearch);
				var strVideoId  	= strVideo.substr(intPos+strSearch.length);
	
				strSearch			= "/";	
				intPos 				= strVideoId.indexOf(strSearch);
				var strVideoId1		= strVideoId.substr(0,intPos);
				var strVideoId2		= strVideoId.substr(intPos+1);
				
			} else if( strInput.indexOf("veoh") > -1 ){
	
				var strType			= "veoh";
					
				var strSearch		= "/watch/";
				var intPos 			= strVideo.indexOf(strSearch);
				var strVideoId1 	= strVideo.substr(intPos+strSearch.length);
				
			} else if( strInput.indexOf("livevideo") > -1 ){
	
				var strType			= "livevideo";
					
				var	strVideoOrig	= strVideo;	
				var strSearch		= "/";
				
				if( strVideo.indexOf(strSearch) > -1 ){
				
					// Laatste deel wissen
				
					while( strVideo.indexOf(strSearch) != -1 ){
					
						strVideo = strVideo.substr(strVideo.indexOf(strSearch)+strSearch.length);			
					}
					
					strVideoOrig = strVideoOrig.substr(0,strVideoOrig.length-strVideo.length-1);	
					
					// Eerste deel wissen
					
					strVideo = strVideoOrig;
					
					while( strVideo.indexOf(strSearch) != -1 ){
					
						strVideo = strVideo.substr(strVideo.indexOf(strSearch)+strSearch.length);			
					}
					
					strVideoId1 = strVideo;
				
				} else {
				
					strType	 = "";
				}

			} else if( strInput.indexOf("revver") > -1 ){
	
				var strType			= "revver";
					
				var strSearch		= "/video/";
				var intPos 			= strVideo.indexOf(strSearch);
				
				strVideo 			= strVideo.substr(intPos+strSearch.length);
				strSearch			= "/";
				intPos 				= strVideo.indexOf(strSearch);
				strVideoId1 		= strVideo.substr(0,intPos);
				
			} else if( strInput.indexOf("videu") > -1 ){  
	
				var strType			= "videu";
					
				var strSearch		= "/video/";
				var intPos 			= strVideo.indexOf(strSearch);
				var strVideoId1 	= strVideo.substr(intPos+strSearch.length);	
	
			} else if( strInput.indexOf("liveleak") > -1 ){  
	
				var strType			= "liveleak";
					
				strVideo			= strVideo.replace("&p=1","");
					
				var strSearch		= "view?i=";
				var intPos 			= strVideo.indexOf(strSearch);
				var strVideoId1 	= strVideo.substr(intPos+strSearch.length);	
				
			} else if( strInput.indexOf("spike") > -1 ){  
	
				var strType			= "spike";
	
				var strSearch		= "/";
			
				if( strVideo.indexOf(strSearch) > -1 ){
				
					// Laatste deel wissen
				
					while( strVideo.indexOf(strSearch) != -1 ){
					
						strVideo = strVideo.substr(strVideo.indexOf(strSearch)+strSearch.length);			
					}
					
					var strVideoId1 = strVideo;	
				
				} else {
				
					strType	 = "";
				}
				
			} else if( strInput.indexOf("megavideo") > -1 ){  
	
				var strType			= "megavideo";
					
				var strSearch		= "/?v=";
				var intPos 			= strVideo.indexOf(strSearch);
				var strVideoId1 	= strVideo.substr(intPos+strSearch.length);		
			
			} else if( strInput.indexOf("nos") > -1 ){  
	
				var strType			= "nos";
					
				var strSearch		= "tcmid/";
				var intPos 			= strVideo.indexOf(strSearch);
				var strVideoId1 	= strVideo.substr(intPos+strSearch.length);	
				
				if( strVideoId1.substr(strVideoId1.length-1,1) == "/" ){
					
					strVideoId1 = strVideoId1.substr(0,strVideoId1.length-1)
				}
				
			}		
						
			$("#fldVideoType").val('');
			$("#fldVideoTypeId1").val('');
			$("#fldVideoTypeId2").val('');		
			$("#fldVideoType").val(strType);
			$("#fldVideoTypeId1").val(strVideoId1);
			$("#fldVideoTypeId2").val(strVideoId2);
		
			if( strType != "" && strType != undefined ){

				fncLoadVideo(strDiv,strType,strVideoId1,strVideoId2);

			} else {
			
				$('#errorfldVideoLink').css('display','block');	
				
				if ( $("#"+strDiv).length > 0 ){
		
					$("#"+strDiv).remove();
				}
			}
			
		}

	}
	
	function fncLoadVideo(strDiv,strType,strId1,strId2){
	
		if ( $("#"+strDiv).length > 0 ){

			$("#"+strDiv).remove();
		}
		
		var intHoogte 	=  $("#"+strDiv+"Holder").height();
		var intBreedte	=  $("#"+strDiv+"Holder").width();			
		
		$("#"+strDiv+"Holder").append("<div id=\""+strDiv+"\" style=\"height:"+intHoogte+"px;width:"+intBreedte+"px;\"></div>");
		
		var arrVars 				= {};
								
		var arrParams 				= {};

		arrParams.scale 			= "noscale";	
		arrParams.wmode 			= "transparent";	
		arrParams.allowFullScreen 	= "true";
		arrParams.AllowScriptAccess = "always";
								
		var arrAttributes 			= {};
		
		if( strType != '' && strId1 != '' ){
		
			if( strType == "youtube" ){
			
				swfobject.embedSWF("http://www.youtube.com/v/"+strId1, strDiv, intBreedte, intHoogte, "9.0.0","expressInstall.swf", arrVars, arrParams, arrAttributes);
									
			} else if( strType == "google" ){
						
				swfobject.embedSWF("http://video.google.com/googleplayer.swf?docId="+strId1, strDiv, intBreedte, intHoogte, "9.0.0","expressInstall.swf", arrVars, arrParams, arrAttributes);
	
			} else if( strType == "myvideo" ){
						
				swfobject.embedSWF("http://www.myvideo.nl/movie/"+strId1, strDiv, intBreedte, intHoogte, "9.0.0","expressInstall.swf", arrVars, arrParams, arrAttributes);		
	
			} else if( strType == "myspace" ){
						
				swfobject.embedSWF("http://mediaservices.myspace.com/services/media/embed.aspx/m="+strId1, strDiv, intBreedte, intHoogte, "9.0.0","expressInstall.swf", arrVars, arrParams, arrAttributes);		
			
			} else if( strType == "dailymotion" ){
				
				swfobject.embedSWF("http://www.dailymotion.com/swf/"+strId1, strDiv, intBreedte, intHoogte, "9.0.0","expressInstall.swf", arrVars, arrParams, arrAttributes);
	
			} else if( strType == "clipfish" ){
	
				swfobject.embedSWF("http://www.clipfish.de/cfng/flash/clipfish_player_3.swf?as=0&vid="+strId1+"&r=1&area=e&c=990000", strDiv, intBreedte, intHoogte, "9.0.0","expressInstall.swf", arrVars, arrParams, arrAttributes);
	
			} else if( strType == "sevenload" ){
	
				arrVars.configPath	 	= "http%3A%2F%2Fflash.sevenload.com%2Fplayer%3FportalId%3Den%26autoplay%3D0%26mute%3D0%26itemId%3D"+strId1+"&locale=en_US&autoplay=0&environment=";	
				
				swfobject.embedSWF("http://static.sevenload.com/swf/player/player.swf?v=142", strDiv, intBreedte, intHoogte, "9.0.0","expressInstall.swf", arrVars, arrParams, arrAttributes);	
				
			} else if( strType == "metacafe" ){
	
				swfobject.embedSWF("http://www.metacafe.com/fplayer/" + strId1 + ".swf", strDiv, intBreedte, intHoogte, "9.0.0","expressInstall.swf", arrVars, arrParams, arrAttributes);	
				
			} else if( strType == "vimeo" ){
	
				swfobject.embedSWF("http://vimeo.com/moogaloop.swf?clip_id=" + strId1 + "&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1", strDiv, intBreedte, intHoogte, "9.0.0","expressInstall.swf", arrVars, arrParams, arrAttributes);					
	
			} else if( strType == "yahoo" ){
				
				arrVars.id 				= strId2;	
				arrVars.vid 			= strId1;	
				arrVars.lang 			= "en-us";		
				arrVars.intl 			= "us";	
				arrVars.embed 			= "1";					

				swfobject.embedSWF("http://d.yimg.com/static.video.yahoo.com/yep/YV_YEP.swf?ver=2.2.46", strDiv, intBreedte, intHoogte, "9.0.0","expressInstall.swf", arrVars, arrParams, arrAttributes);				
				
			} else if( strType == "veoh" ){
	
				swfobject.embedSWF("http://www.veoh.com/static/swf/webplayer/WebPlayer.swf?version=AFrontend.5.4.3.1017&permalinkId=" + strId1 + "&player=videodetailsembedded&videoAutoPlay=0&id=anonymous", strDiv, intBreedte, intHoogte, "9.0.0","expressInstall.swf", arrVars, arrParams, arrAttributes);				
				
			} else if( strType == "livevideo" ){
					
				swfobject.embedSWF("http://www.livevideo.com/flvplayer/embed/" + strId1, strDiv, intBreedte, intHoogte, "9.0.0","expressInstall.swf", arrVars, arrParams, arrAttributes);
				
			} else if( strType == "revver" ){

				arrVars.mediaId			= strId1;		
				arrVars.width 			= intBreedte;		
				arrVars.height 			= intHoogte;						
				
				swfobject.embedSWF("http://flash.revver.com/player/1.0/player.swf?r=revver"+strId1+"12569227569459384", strDiv, intBreedte, intHoogte, "9.0.0","expressInstall.swf", arrVars, arrParams, arrAttributes);	
	
			} else if( strType == "videu" ){
	
				swfobject.embedSWF("http://www.videu.de/flv/player2.swf?iid=" + strId1, strDiv, intBreedte, intHoogte, "9.0.0","expressInstall.swf", arrVars, arrParams, arrAttributes);
				
			} else if( strType == "liveleak" ){
	
				swfobject.embedSWF("http://www.liveleak.com/e/" + strId1, strDiv, intBreedte, intHoogte, "9.0.0","expressInstall.swf", arrVars, arrParams, arrAttributes);
				
			} else if( strType == "spike" ){
					
				arrVars.flvbaseclip 	= strId1;
				
				swfobject.embedSWF("http://www.spike.com/efp", strDiv, intBreedte, intHoogte, "9.0.0","expressInstall.swf", arrVars, arrParams, arrAttributes);		
	
			} else if( strType == "megavideo" ){
	
				arrVars.flvbaseclip 	= strId1;	
				
				swfobject.embedSWF("http://www.megavideo.com/v/" + strId1, strDiv, intBreedte, intHoogte, "9.0.0","expressInstall.swf", arrVars, arrParams, arrAttributes);
	
			} else if( strType == "nos" ){
				
				swfobject.embedSWF("http://player.nos.nl/nos/media/flash/nos_video_embed.swf?tcmid=" + strId1, strDiv, intBreedte, intHoogte, "9.0.0","expressInstall.swf", arrVars, arrParams, arrAttributes);
			}
			
		} 

	}
