﻿// IC WCMS JavaSricpt Functions Library
// IruCom WebCMS Version 5.0
// Copyright Pragash Irudayam ( IruCom systems ) 2009
// IruCom WebCMS Release Date : 01.03.09  - RV2
// Licence only for one Domain. No changes or addons are allowed without prior permisssion from Pragash Irudayam (IruCom systems)

// Needs the IruCom WebCMS Basic Library.

function IC_JS_Display_Video(mv_box_id, mv_pimg_id, mv_url, mv_application, mv_variables)
{
	/* Only for Standard Browsers*/
	
	if (typeof(document.getElementById) != 'undefined') 
	{
		var display_box = document.getElementById(mv_box_id);			
		// Check previw image
		if (typeof(document.getElementById(mv_pimg_id)) != 'undefined') 
		{
			mv_preview_img = document.getElementById(mv_pimg_id);
			mv_preview_img.style.display = 'none';
		}
		// End preview image		
	}    
    else 
	{
       return false;		
  }
	
	if(IC_JS_Delete_ChildNodes(mv_box_id))
	{
		if(mv_application == "Quicktime")
		{
			var mv_obj = document.createElement("object");
			mv_obj.setAttribute('id', 'ms_id5');
			mv_obj.setAttribute('width', '360');
			mv_obj.setAttribute('height', '260');
			mv_obj.setAttribute('type', 'video/quicktime');
			mv_obj.setAttribute('data', mv_url);
					
			var mv_obj_para_1 = document.createElement("param");
			mv_obj_para_1.setAttribute('name', 'movie');	
			mv_obj_para_1.setAttribute('value', mv_url);			
				
			var mv_obj_para_2 = document.createElement("param");
			mv_obj_para_2.setAttribute('name', 'autoplay');	
			mv_obj_para_2.setAttribute('value', 'true');	
			
			var mv_obj_para_con = document.createElement("param");
			mv_obj_para_con.setAttribute('name', 'controller');	
			mv_obj_para_con.setAttribute('value', 'true');
			
			var mv_obj_emb = document.createElement("embed");		
			mv_obj_emb.setAttribute('src', mv_url);
			mv_obj_emb.setAttribute('width', '360');
			mv_obj_emb.setAttribute('height', '260');
			mv_obj_emb.setAttribute('type', 'video/quicktime');
			
				
			mv_obj.appendChild(mv_obj_para_1);
			mv_obj.appendChild(mv_obj_para_2);		
			mv_obj.appendChild(mv_obj_para_con);				
			
			// Embed
			mv_obj.appendChild(mv_obj_emb);		
			// Insert Element to the Display Box
			display_box.appendChild(mv_obj);	
		}
		
		
		if(mv_application == "FlashVideo")
		{
			// IruCom WebCMS Standard FLV Player		
			if(! (IC_JS_Browser_Standard()) )
			{
				// Embed
				var em_mv_url = "ic_web_movie/IruCom_WebCMS_FLV_Player6.swf?" + mv_variables ;
					
				var em_obj_em = document.createElement("embed");				
				em_obj_em.setAttribute('src', em_mv_url);
				em_obj_em.setAttribute('type', 'application/x-shockwave-flash');
				em_obj_em.setAttribute('width', '550');
				em_obj_em.setAttribute('height', '380');			
										
				// Insert Element to the Display Box
				display_box.appendChild(em_obj_em);
				
			}
			else
			{
				var mv_obj = document.createElement("object");				
				mv_obj.setAttribute('type', 'application/x-shockwave-flash');
				mv_obj.setAttribute('data', 'ic_web_movie/IruCom_WebCMS_FLV_Player6.swf');
			
				//mv_obj.setAttribute('id', 'ms_id5');
				mv_obj.setAttribute('width', '550');
				mv_obj.setAttribute('height', '380');
				
				var mv_obj_para_1 = document.createElement("param");
				mv_obj_para_1.setAttribute('name', 'movie');	
				mv_obj_para_1.setAttribute('value', 'ic_web_movie/IruCom_WebCMS_FLV_Player6.swf');			
					
				var mv_obj_para_2 = document.createElement("param");
				mv_obj_para_2.setAttribute('name', 'autoplay');	
				mv_obj_para_2.setAttribute('value', 'true');	
				
				var mv_obj_para_3 = document.createElement("param");
				mv_obj_para_3.setAttribute('name', 'quality');	
				mv_obj_para_3.setAttribute('value', 'high');
				
				var mv_obj_para_fvar = document.createElement("param");
				mv_obj_para_fvar.setAttribute('name', 'FlashVars');	
				mv_obj_para_fvar.setAttribute('value', mv_variables);
								
				mv_obj.appendChild(mv_obj_para_1);
				mv_obj.appendChild(mv_obj_para_2);	
				mv_obj.appendChild(mv_obj_para_3);	
				mv_obj.appendChild(mv_obj_para_fvar);	
			
				// Embed
				var em_mv_url = "ic_web_movie/IruCom_WebCMS_FLV_Player6.swf?" + mv_variables ;
					
				var em_obj_em = document.createElement("embed");				
				em_obj_em.setAttribute('src', em_mv_url);
				em_obj_em.setAttribute('type', 'application/x-shockwave-flash');
				em_obj_em.setAttribute('width', '550');
				em_obj_em.setAttribute('height', '380');			
				mv_obj.appendChild(em_obj_em);
							
				// Insert Element to the Display Box
				display_box.appendChild(mv_obj);
				
				}		
		}
		
		
		if(mv_application == "MP3")
		{
			// IruCom WebCMS Standard FLV Player		
			if(! (IC_JS_Browser_Standard()) )
			{
				// Embed
				var em_mv_url = "ic_web_music/IruCom_WebCMS_Music_Player6.swf?" + mv_variables ;
					
				var em_obj_em = document.createElement("embed");				
				em_obj_em.setAttribute('src', em_mv_url);
				em_obj_em.setAttribute('type', 'application/x-shockwave-flash');
				em_obj_em.setAttribute('width', '550');
				em_obj_em.setAttribute('height', '120');			
										
				// Insert Element to the Display Box
				display_box.appendChild(em_obj_em);
				
			}
			else
			{
				var mv_obj = document.createElement("object");				
				mv_obj.setAttribute('type', 'application/x-shockwave-flash');
				mv_obj.setAttribute('data', 'ic_web_nusic/IruCom_WebCMS_Music_Player6.swf');
			
				//mv_obj.setAttribute('id', 'ms_id5');
				mv_obj.setAttribute('width', '550');
				mv_obj.setAttribute('height', '120');
				
				var mv_obj_para_1 = document.createElement("param");
				mv_obj_para_1.setAttribute('name', 'movie');	
				mv_obj_para_1.setAttribute('value', 'ic_web_music/IruCom_WebCMS_Music_Player6.swf');			
					
				var mv_obj_para_2 = document.createElement("param");
				mv_obj_para_2.setAttribute('name', 'autoplay');	
				mv_obj_para_2.setAttribute('value', 'true');	
				
				var mv_obj_para_3 = document.createElement("param");
				mv_obj_para_3.setAttribute('name', 'quality');	
				mv_obj_para_3.setAttribute('value', 'high');
				
				var mv_obj_para_fvar = document.createElement("param");
				mv_obj_para_fvar.setAttribute('name', 'FlashVars');	
				mv_obj_para_fvar.setAttribute('value', mv_variables);
								
				mv_obj.appendChild(mv_obj_para_1);
				mv_obj.appendChild(mv_obj_para_2);	
				mv_obj.appendChild(mv_obj_para_3);	
				mv_obj.appendChild(mv_obj_para_fvar);	
			
				// Embed
				var em_mv_url = "ic_web_music/IruCom_WebCMS_Music_Player6.swf?" + mv_variables ;
					
				var em_obj_em = document.createElement("embed");				
				em_obj_em.setAttribute('src', em_mv_url);
				em_obj_em.setAttribute('type', 'application/x-shockwave-flash');
				em_obj_em.setAttribute('width', '550');
				em_obj_em.setAttribute('height', '120');			
				mv_obj.appendChild(em_obj_em);
							
				// Insert Element to the Display Box
				display_box.appendChild(mv_obj);
				
			}		
		
		}
		// goto display box
		IC_JC_Scroll_To(500);
	}

}
