/* changed by lucian Mar 2010 - added autoplay param */
function playVideoClip(file, rating, img, mature_content, autoplay)
{	
	// <![CDATA[	
	var version = deconcept.SWFObjectUtil.getPlayerVersion();
	if ($('flasher') && version['major'] < 9) {
		$('flashversion').innerHTML = "Your Flash Player version is: "+ version['major'] +"."+ version['minor'] +"."+ version['rev'] +". You need   <a href='http://www.adobe.com/products/flashplayer/'>The Latest Version</a> in order to view the video content of GAMEX TV!";
	}
	else {
		
		var s1_1 = new SWFObject(self_location +"player.swf","mediaplayer","630","370","9");
		s1_1.addParam("allowfullscreen","true");		
		s1_1.addParam("bgcolor","#FFFFFF");
		s1_1.addParam("wmode","transparent");
		s1_1.addVariable("javascriptid","mediaplayer");
		//s1_1.addVariable("id","mediaplayer");

		s1_1.addParam("flashvars","skin="+ self_location +"overlay.swf&autostart="+(autoplay=="1"?"true":"false")+"&controlbar=over&file="+file+"&image="+img+"&width=630&height=413");
		s1_1.addVariable("rating",0);
		s1_1.addVariable("searchbar","false");
		s1_1.write("flasher");
		
		
	}
	// ]]>
}


function playSWF() {
	var s1_1 = new SWFObject(self_location +"finalafanilor300x250.swf","mediaplayer","300","250","9");
		s1_1.addParam("allowfullscreen","true");
		s1_1.addParam("bgcolor","#FFFFFF");
		s1_1.addParam("wmode","transparent");
		s1_1.write("flasher_swf");
}

function setrandom_banner(id_container,type) {
	// type=1 banner top; type=2 banner right
	if(type==1) {
		video = new Array();
		video[1] = 'http://www.gamextv.com/banners/rising_728x90.swf';
		video[2] = 'http://www.gamextv.com/banners/bucharest_728x90.swf';
		video[3] = 'http://www.gamextv.com/banners/favorite_character_728x90.swf';
		video[4] = 'http://www.gamextv.com/banners/blockbusters_728x90.swf';
		rnd = parseInt(Math.random()*4	+1);	
		Banner('reclama',video[rnd],'728','90',0);
	}
	else if(type==2) {
		video = new Array();
		video[1] = 'http://www.gamextv.com/banners/rising_300x250.swf';
		video[2] = 'http://www.gamextv.com/banners/favorite_character_300x250.swf';
		video[3] = 'http://www.gamextv.com/banners/blockbusters_300x250.swf';	
		rnd = parseInt(Math.random()*3	+1);		
		Banner('flasher_swf',video[rnd],'300','250',0);
	}
}

function Banner(id_container,src_flv,width,height,is_transparent) {
	var s1_1 = new SWFObject(src_flv,"mediaplayer",width,height,"9");
		s1_1.addParam("allowfullscreen","false");
		s1_1.addParam("wmode","transparent");
		s1_1.addParam("bgcolor","#000");
		if(is_transparent)
			s1_1.addParam("wmode","transparent");
		
		s1_1.write(id_container);
}

function Show_Banner(id_container,src_flv,width,height,is_transparent,img) {
	var s1_1 = new SWFObject(self_location +"player.swf","mediaplayer","630","413","9");
		s1_1.addParam("allowfullscreen","true");		
		
		if(is_transparent)
			s1_1.addParam("wmode","transparent");
		
		if(img){
			s1_1.addParam("flashvars","skin="+ self_location +"overlay.swf&file="+src_flv+"&image="+img+"&width=630&height=413");
			s1_1.addVariable("rating",0);
			s1_1.addVariable("searchbar","false");
		}
				
		s1_1.write(id_container);
}

/* changed by lucian Mar 2010 - added file, image, autoplay params */
function voteaza_stream(id_container, vfile, vimg, vautoplay) {
	if ( typeof(vfile)=="undefined" ) vfile="playlist_new.xml"
	if ( typeof(vimg)=="undefined" ) vimage=""; else vimage = "&image="+vimg;
	if ( vautoplay!="1" ) vautoplay = "false"; else vautoplay = "true";
  /* end changed by lucian Mar 2010 - added file, image, autoplay params */
	var s1_1 = new SWFObject(self_location +"player.swf","mediaplayer","634","355","9");
	s1_1.addParam("allowfullscreen","true");		
	s1_1.addParam("wmode","transparent");
	s1_1.addParam("flashvars","skin="+ self_location +"overlay.swf&file="+vfile+"&autostart="+vautoplay+vimage+"&controlbar=over&stretching=fill&width=634&height=355");
	s1_1.addVariable("rating",0);
	s1_1.addVariable("searchbar","false");
	s1_1.write(id_container);
}

function concurs_es(src_flv,img)
{
	var s1_1 = new SWFObject(self_location +"player.swf","mediaplayer","540","310","9");
		s1_1.addParam("allowfullscreen","true");		
		s1_1.addParam("wmode","transparent");
		s1_1.addParam("flashvars","skin="+ self_location +"overlay.swf&file="+src_flv+"&image="+img+"&width=540&height=310");
		s1_1.addVariable("rating",0);
		s1_1.addVariable("searchbar","false");
		
				
		s1_1.write('flasher');
}

function playRightVideoClip(file,img,width,height,container)
{	
	// <![CDATA[	
	var version = deconcept.SWFObjectUtil.getPlayerVersion();
	if ($('flasher') && version['major'] < 9) {
		$('flashversion').innerHTML = "Your Flash Player version is: "+ version['major'] +"."+ version['minor'] +"."+ version['rev'] +". You need   <a href='http://www.adobe.com/products/flashplayer/'>The Latest Version</a> in order to view the video content of GINX TV!";
	}
	else{
		
		var s1_1 = new SWFObject(self_location +"player.swf","mediaplayer",width,height,"9");
		s1_1.addParam("allowfullscreen","true");
		s1_1.addParam("bgcolor","#FFFFFF");
		s1_1.addParam("wmode","transparent");
		/*
		s1_1.addVariable("width","630");
		s1_1.addVariable("height","470");
		
		s1_1.addVariable("file",file);
		s1_1.addVariable("image",img);
		*/
		s1_1.addParam("flashvars","skin="+ self_location +"overlay.swf&file="+file+"&image="+img+"&width="+width+"&height="+height+"&icons=false&controlbar=over&stretching=fill");
		s1_1.addVariable("rating",0);
		s1_1.addVariable("searchbar","false");		
		s1_1.write(container);
		}
	// ]]>
}

function header_list(id)
{	
	if(id=='newsletter') {
		$('top-feedback').style.display = 'none';
		$('feedback_btn').style.color = '#CCC';
	}
	else{
			$('top-newsletter').style.display = 'none';
			$('newsletter_btn').style.color = '#CCC';
		}
	
	
	$(id+'_btn').style.color = '#FF9900';	
	$('top-'+id).style.display = 'block';
	
}

function forgotfields() 
{	
	if($('forgot_msg'))
		$('forgot_msg').style.display = 'none';
		
	if($('forgot_msg_1'))
		$('forgot_msg_1').style.display = 'none';
	
	if($('newsletter_error'))
		$('newsletter_error').style.display = 'none';
	
}

function playNewsxVideo(mp4_file_id,mp4_title,mp4_segment_title) 
{
	if(!mp4_file_id)
		mp4_file_id = 2827
	
	if(mp4_title && $('videotitle'))
		$('videotitle').innerHTML = mp4_title;
	
	if(mp4_segment_title && $('h_segment_title'))
		$('h_segment_title').innerHTML = mp4_segment_title;
	
	
	file = 'http://85.9.22.242/gx_video_'+mp4_file_id+'.mp4';
	
	var s1_1 = new SWFObject(self_location +"player.swf","mediaplayer","630","370","9");
	s1_1.addParam("allowfullscreen","true");
	s1_1.addParam("wmode","transparent");	
	s1_1.addVariable("javascriptid","mediaplayer");
	s1_1.addVariable("id","mediaplayer");

	s1_1.addParam("flashvars","skin="+ self_location +"overlay.swf&autostart=true&controlbar=over&file="+file+"&width=630&height=370");
	s1_1.addVariable("rating",0);
	s1_1.addVariable("searchbar","false");
	s1_1.write("flasher");
}
