var docsFLU = {
	id: 0 ,
	plot:0 ,
	updaterUrl: '?ajax/documentslist_Update',
	resultUrl:  '?ajax/checkDocUploadResult',
	prefix:'',
	
	
    init:function (id,prefix)
    { 
		this.prefix = prefix;
		this.id = id;
		this.plot = $('doc_player_list');
	 	this.sendRequest();
	
	},
	 
	sendRequest: function() {
					new Ajax.Request(this.updaterUrl, {
					 parameters: "id="+this.id,
					 onSuccess: this.processProgressInfo.bindAsEventListener(this)
				 });
	} , 
	
	 checkRequest: function(transport) {
		if(transport.headerJSON)
		$('upload_result').innerHTML = transport.headerJSON['result']; //transport.headerJSON;
	 } , 
	
	 
	processProgressInfo:function (transport)
    { 	
	
		
		var html = '';
		if(transport.headerJSON)
		{
											
			for(i=0;i<transport.headerJSON.length;i++) 
			{	
						//
			 var sLink =    this.prefix + 
			 				this.id  + '/' +  transport.headerJSON[i].id  + 
							'/' + 'delfile' ;
					
					html +=   '<div class="line" >';
					html +=   '<div class="row_name" >';
					html +=  transport.headerJSON[i].filename;
					html +=   "</div>";
					
				
					html +=   "<div  class=\"row\" ><strong>";
					html +=  transport.headerJSON[i].filetype_name;
					html +=   "</strong></div>";
					
					
					html +=   '<div class="row" >&nbsp;&nbsp;&nbsp;';
					html +=  transport.headerJSON[i].uploaded;
					html +=   "</div>";
				 	html +=   '<div class="row" ><a href="' +  sLink  + '" 	onclick=\"return confirm(\' File is going to be deleted. Click OK to proceed.\');\" >';
				 	html +=  'DELETE';
				 	html +=   "</a></div>";
					
					
					html +=   "</div>";
				 	html +=   "<div class=\"clear\" ></div>";
			} 
			
			
		} 
			
			this.plot.innerHTML   = 		html;
			this.getResult();
		
	} ,
	
		
	
	getResult:function()
	{ 
		
			new Ajax.Request(this.resultUrl + '/' + this.id , {
					 parameters: "",
					 onSuccess: this.checkRequest.bindAsEventListener(this)
				 });  }
	
} 

	

	
var docsFU = {
						
						
	updaterUrl: '/ajax/checkDocUpload',
	progressTimer:0 ,
	activeUpload:0 ,  
	progressTimer:0,
	form: '',
	UniqueId: 0,
	uploadFrame: 0,
	pbar:0,
	acttion:0,
	plot_id:0 ,
	rid:0 , 
	form:0,
	hd:0,
	delPrefix:'',
	
   renum:function()
   {
		this.UniqueId            =  this.getUniqueId();
		this.activeUpload 	     = this.UniqueId ;
	    this.hd.value    		 = this.UniqueId ;
	  
	  if (this.uploadFrame)
	  {
			$F("uploadframe")	 = this.UniqueId ;
		/* this.form.target  =  this.UniqueId;  //this.uploadFrame;
	  	*/
	  }
	 	 else 
	  { 

		  this.form.target  =  this.getUploadIFRAME(this.UniqueId);
	  } 
	  

	},
	
    init_form:function (plot_id,action,rid,delprefix)
    { 
	  	this.delPrefix =  delprefix;
	 
	   this.rid = rid;
	   if(plot_id)
	   this.plot_id = plot_id;
		
	   if(action)
	   this.action = action;
		
   	   plot =  $(   this.plot_id );
	   
	   plot.innerHTML	 = "";
	   this.UniqueId  	 = this.getUniqueId();
	   this.activeUpload = this.UniqueId ;
	    
		// Sets its target in dynamic IFRAME
		// Method = POST, Enctype = multipart for file uploads
		// Hide the form
  		// form.className = 'sd-hidden';
		// Sets its action to the upload URL
		
		 
		 
		
		this.form         =  document.createElement("form");
		this.form.id      =  this.UniqueId;
		this.form.method  =  'POST';
		this.form.enctype =  this.form.encoding = 'multipart/form-data';
		this.form.action  =  this.action;
		this.form.target  =  this.getUploadIFRAME(this.UniqueId);
		 
	
		 this.hd       = document.createElement('input');
		 this.hd.type  = 'hidden'; 
		 this.hd.name  = 'APC_UPLOAD_PROGRESS';
		 this.hd.value = this.UniqueId ;
		 this.hd.id    = 'hd_id';
		 this.form.appendChild(this.hd);
	
		 hmax = document.createElement('input');
		 hmax.type = 'hidden'; 
		 hmax.name = 'MAX_FILE_SIZE';
		 hmax.value =  104857600 ;
		 this.form.appendChild(hmax);

		
		 plot.appendChild(this.form);
	     this.pbar = this._getBar();
		
			 Event.observe(this.form, 'submit', function(event) {
			$('myupload').disabled = true;
			docsFU.progressRequest();
				
				});
		
		
	} ,
	
	end_from:function()
	{ 
	
 	}, 
	
 
	
	
	additem:function(o)
	{ 
		 this.form.appendChild(o);
 	}, 

	 _getBar: function (formid)
	{ 		
		if(   this.pbar  )
		return    this.pbar ;
		
	    this.pbar = new Ext.ProgressBar({id:'pbar3',width:300,renderTo:'p3'});
		return   this.pbar ;
	}  , 
	
	
	
	getUniqueId: function() {
		
			
				 chars = "0123456789abcdefghijklmnopqurstuvwxyzABCDEFGHIJKLMNOPQURSTUVWXYZ";
				 var str = "";
				 for(var i = 0; i < 32; i++)
				 {
				 rand = Math.floor(Math.random() * 32);
				 str += chars.substr( rand, 1 );
				}
				 return str;
	
	 },
	 
	 
	 uploadReady: function() {
	 	clearInterval(this.progressTimer);
		this.activeUpload = 0;
		this.progressTimer = 0;
		$('myupload').disabled = false;
		docsFLU.init(this.rid, this.delPrefix);
		this.renum();
	
	},


	
	 _onFormSubmit : function()
    { 
	

		
			$('myupload').disabled = true;
			docsFU.progressRequest();
			
	},
	
	 sendProgressRequest: function() {
		 

				new Ajax.Request(this.updaterUrl, {
				 parameters: "upload="+this.UniqueId,
				 onSuccess: this.processProgressInfo.bindAsEventListener(this)
			
				 }
				 
				 
				 );
				
				
	 } , 
	
		
	setProgress: function(percent,id) {
			//	    var i = percent/100;
             //     Ext.fly(id).updateProgress(i, Math.round(100*i)+'% completed...');
	 } ,
	 
	 
	 progressRequest: function() {
		
			 if (this.progressTimer) {	
			                  return false;
			 }
			this.sendProgressRequest();

			this.progressTimer = setInterval(this.sendProgressRequest.bind(this),1000);
			
			
    },
	
	
	processProgressInfo: function(transport) {
	
		if (transport.headerJSON.done && !transport.headerJSON.cancel_upload)
		{
			  this.pbar.updateText('UPLOAD is DONE');
			  return this.uploadReady();
		} 
		
		
	
		 var i  =	 transport.headerJSON.percent;
	   	 this.pbar.updateProgress(i/100, Math.round(i)+'% completed...');
	} ,
			
	  getUploadIFRAME: function() {
		  
		  
			 var  ua = navigator.userAgent.toLowerCase();
			 var  isOpera = ua.indexOf("opera") > -1;
			 var  isIE  = !isOpera && ua.indexOf("msie") > -1;
			 var  isIE7 = !isOpera && ua.indexOf("msie 7") > -1;
			// if(isIE7)
			 if (this.uploadFrame) return this.uploadFrame;
			 id = "uploadframe";
			 var frame = document.createElement('iframe');
			 frame.id = id;
			 frame.name = id;
			 frame.className = 'sd-hidden';
			
			
		  	if(isIE  ){
			 frame.src = "javascript:false";
			 }
			
			 document.body.appendChild(frame);
			 
			if(isIE ){
			 document.frames[id].name = id;
			 }
			 $(frame).observe("load",this.uploadReady.bindAsEventListener(this));
			 return this.uploadFrame = id;
		    } 
			 
			 
			 
} 






































var FLU = {
	
	id: 0 ,
	plot:0 ,
	updaterUrl: '?admin/players/flashlist_Update',
	resultUrl: '?ajax/checkFlashUploadResult',
	
	prefix:0,
	

    init:function (id,prefix)
    { 
		this.prefix = prefix;
		this.id = id;
		this.plot = $('flashlist');
	 	this.sendRequest();
	
	},
	
	
	 checkRequest: function(transport) {
	
		if(transport.headerJSON)
		$('upload_result').innerHTML = transport.headerJSON['result']; //transport.headerJSON;
		
	} , 
	
	
	
	 sendRequest: function() {
					new Ajax.Request(this.updaterUrl, {
					 parameters: "id="+this.id,
					 onSuccess: this.processProgressInfo.bindAsEventListener(this)
				 });
				 
	} , 
	 
	processProgressInfo:function (transport)
    { 	
	
		
		var html = '';
		if(transport.headerJSON)
		{
											
			for(i=0;i<transport.headerJSON.length;i++) 
			{	
						//
			 var sLink =    '/admin/players/delflash/' + 
			 				this.id  + '/' +  transport.headerJSON[i].id  + 
							'/' + 'delfile' ;
					
					html +=   '<div class="line" >';
					html +=   '<div class="row" >';
					html +=  transport.headerJSON[i].filename;
					html +=   "</div>";
					html +=   '<div class="row" >&nbsp;&nbsp;&nbsp;';
					html +=  transport.headerJSON[i].uploaded;
					html +=   "</div>";
				 	html +=   '<div class="row" ><a href="' +  sLink  + '" 	onclick=\"return confirm(\' File is going to be deleted. Click OK to proceed.\');\" >';
				 	html +=  'DELETE';
				 	html +=   "</a></div>";
					html +=   "</div>";
				 	html +=   "<div class=\"clear\" ></div>";
			} 
		} 
	
			this.plot.innerHTML   = 		html;
			this.getResult();
	 	
	} ,
	
	getResult:function()
	{ 
		
			new Ajax.Request(this.resultUrl, {
					 parameters: "",
					 onSuccess: this.checkRequest.bindAsEventListener(this)
				 });
			
	}
	
	
} 



	

	
	
	
	

	
var FU = {
						
	updaterUrl: '?admin/players/checkUpload',
	progressTimer:0 ,
	activeUpload:0 ,  
	progressTimer:0,
	form: '',
	UniqueId: 0,
	uploadFrame: 0,
	pbar:0,
	acttion:0,
	plot_id:0 ,
	rid:0 , 
	form:0,
	c:0,
	hd:0,
	
		
   renum:function()
   {
			this.UniqueId            =  this.getUniqueId();
			this.activeUpload 	     = this.UniqueId ;
			this.hd.value    		 = this.UniqueId ;
		  
		  if (this.uploadFrame)
		  {
			$F("uploadframe")	 = this.UniqueId ;
		//	 this.form.target  = this.uploadFrame;
		  }
			 else 
		  { 
			  this.form.target  =  this.getUploadIFRAME(this.UniqueId);
		  } 
		  

	},
	
	
	
    init_form:function (plot_id,action,rid)
    { 
	
			 
	   this.rid = rid;
	   if(plot_id)
	   this.plot_id = plot_id;
		
		
	   if(action)
	   this.action = action;
		

		
   	   plot =  $(   this.plot_id );
	   plot.innerHTML = "";
	   this.UniqueId   = 	  this.getUniqueId();
	   this.activeUpload = this.UniqueId ;
	   
			 
		var form = document.createElement("form");
		form.id =  this.UniqueId;
		// Sets its target in dynamic IFRAME
		 // Method = POST, Enctype = multipart for file uploads
		 form.method = 'POST';
		 form.enctype = form.encoding = 'multipart/form-data';
		// Hide the form
	//	 form.className = 'sd-hidden';
		 // Sets its action to the upload URL
		 form.action =    this.action;
		 
		
		 form.target	   = this.getUploadIFRAME(this.UniqueId);
		 
		 
		 	 Event.observe(form, 'submit', function(event) {
			$('myupload').disabled = true;
			FU.progressRequest();
				
				});
				
	 	
	
		 this.hd = document.createElement('input');
		 this.hd.type = 'hidden'; 
		 this.hd.name = 'APC_UPLOAD_PROGRESS';
		 this.hd.value = this.UniqueId ;
		 form.appendChild(this.hd);
	
		 hmax = document.createElement('input');
		 hmax.type = 'hidden'; 
		 hmax.name = 'MAX_FILE_SIZE';
		 hmax.value =  104857600 ;
		 form.appendChild(hmax);

	
		 var  file    = document.createElement("input");
	   	 file.type = "file";	
		 file.name = "flashmovie";
		 file.id = "flashmovie";
		 
//		 file.value = "Select file";
		 
		 
		 var  oSubmit    = document.createElement("input");
	   	 oSubmit.type = "submit";	
		 oSubmit.name = "Selectfile";
		 oSubmit.value = " Upload ";
		 oSubmit.id = "myupload";
	  
		 form.appendChild(file);
		 form.appendChild(oSubmit);
		 plot.appendChild(form);
	     this.pbar = this._getBar();

	  
	
	} ,

	_getBar: function (formid)
	{ 		
		if(   this.pbar  )
		return    this.pbar ;
		
	    this.pbar = new Ext.ProgressBar({
								id:'pbar3',
								width:300,
								renderTo:'p3'
							});
		   
		 return   this.pbar ;
		  
	
	}  , 
	
	
	
	getUniqueId: function() {
		
			
				 chars = "0123456789abcdefghijklmnopqurstuvwxyzABCDEFGHIJKLMNOPQURSTUVWXYZ";
				 var str = "";
				 for(var i = 0; i < 32; i++)
				 {
				 rand = Math.floor(Math.random() * 32);
				 str += chars.substr( rand, 1 );
				}
				 return str;
	
	 },
	 
	 
	 uploadReady: function() {
		 
	 	clearInterval(this.progressTimer);
		this.activeUpload = 0;
		this.progressTimer = 0;
		$('myupload').disabled = false;
		FLU.init(this.rid,'admin/players/delflash/');
		this.renum();
		
		setTimeout(this.resetStatus.bind(this),3000);
				
			
	},


	
	 _onFormSubmit : function()
    { 
			$('myupload').disabled = true;
			FU.progressRequest();
			
	},
	
	 sendProgressRequest: function() {

				new Ajax.Request(this.updaterUrl, {
				 parameters: "upload="+this.UniqueId,
				 onSuccess: this.processProgressInfo.bindAsEventListener(this) });
	 } , 
	
		
	setProgress: function(percent,id) {	 } ,
	 
	 
	 progressRequest: function() {
		
			 if (this.progressTimer) {	
			                  return false;
			 }
			this.sendProgressRequest();
			this.progressTimer = setInterval(this.sendProgressRequest.bind(this),1000);
		
			
    },
	
	
	processProgressInfo: function(transport) {
	
		if (transport.headerJSON.done && !transport.headerJSON.cancel_upload)
		{
			  this.pbar.updateText('UPLOAD is DONE');
			  return this.uploadReady();
		} 
		
			 var i  =	 transport.headerJSON.percent;
	    	 this.pbar.updateProgress(i/100, Math.round(i)+'% completed...');
			 
			 
			 this.c++;
			 
			 if(this.c%2)
			 $('idprobar').innerHTML = ' upload <========> ';
			 else 
			 $('idprobar').innerHTML = ' upload <================>';
			 
			 
				 
		
				
	
	
	} ,
			
	  getUploadIFRAME: function() {
		  
		  
			 var  ua = navigator.userAgent.toLowerCase();
			 var  isOpera = ua.indexOf("opera") > -1;
			 var  isIE  = !isOpera && ua.indexOf("msie") > -1;
			 var  isIE7 = !isOpera && ua.indexOf("msie 7") > -1;
			// if(isIE7)
			 if (this.uploadFrame) return this.uploadFrame;
			 id = "uploadframe";
			 var frame = document.createElement('iframe');
			 frame.id = id;
			 frame.name = id;
			 frame.className = 'sd-hidden';
			
			
		  	if(isIE  ){
			 frame.src = "javascript:false";
			 }
			
			 document.body.appendChild(frame);
			 
			if(isIE ){
			 document.frames[id].name = id;
			 }
			 $(frame).observe("load",this.uploadReady.bindAsEventListener(this));
			 return this.uploadFrame = id;
		    } 
			 
			 
			 
} 



function getNewSubmitForm(){
 var submitForm = document.createElement("FORM");
 document.body.appendChild(submitForm);
 submitForm.method = "post";
 

 return submitForm;
}


function Filerusers(mylink)
{
	
		 var val = 		  $F('filtertype');
		 var submitForm = getNewSubmitForm();
		 var filter = document.createElement("input");
		 var flag   = document.createElement("input");
		
		
		 flag.setAttribute('value', '1');	
	  	 flag.type = "hidden";	
		 flag.name = "flag";
		   
	
		 filter.setAttribute('value', val );	
	  	 filter.type = "hidden";	
		 filter.name = "filtertype";
		  
		 
		 submitForm.action= mylink;
     	 submitForm.appendChild(filter);
		 submitForm.appendChild(flag);
		 submitForm.submit();
		 
	

	     return false;
} 


function DelFilter2(mylink,str) 
{ 

	if(confirm('User ' + str + ' is going to be deleted. Click OK to proceed.'))
	return true;
	else 
	return false;
	
	


} 



function DelFilter(mylink,str) 
{ 

	if(confirm('User ' + str + ' is going to be deleted. Click OK to proceed.'))
	return Filerusers(mylink);
	else 
	return false;
	
	


} 




function RestoreFilter(mylink,str) 
{ 

	if(confirm('User ' + str + ' is going to be Restore. Click OK to proceed.'))
	return Filerusers(mylink);
	else 
	return false;


} 



function CreateForm(element,action)
{
	
	element.innerHTML  
	= 
   '<FORM action=' + action  + ' method="post"  id="picsform"  name="picsform" enctype="multipart/form-data" >';  		
	return element;
	
}


function DoFileInput(id)
{
		var divroot	 = document.getElementById('picplot');
		var picnode  = document.createElement("div");
		var newimg  = document.getElementById("first_plot");
			
		picnode.setAttribute('name',"picwrap1"  );
		picnode.setAttribute('class',"picwrap" );
		
		divroot.insertBefore(picnode,divroot.firstChild);
		
		
		CreateForm(picnode);
		newimg.innerHTML = '';
		FileImputElement(picnode.firstChild,"pimage","new");	
		
	
} 

function  DoReplace(id,url,picinfo)
{
	

		var  picdiv  	= document.getElementById('picplot' + id  );
	    CreateForm(picdiv , url);
		FileImputElement(picdiv.firstChild,"pimage","new",picinfo);	
		
	
}



function  DoReplace2(id,url)
{
	

		var  picdiv  	= document.getElementById('picplot' + id  );
	    CreateForm(picdiv , url);
		FileImputElement2(picdiv.firstChild,"pimage","new");	
		
	
}



function FileImputElement(element,name,upload,picinfotext)
{ 

		var  form  			= document.getElementById('picsform');
		var filenode  	    = document.createElement("input");
		var hidennode  		= document.createElement("input");
		var actnode    		= document.createElement("input");
		var maxfilesize     = document.createElement("input");
		var picinfo         = document.createElement("textarea");
	
		
			  
		maxfilesize.setAttribute('value', "2097152" );	
		maxfilesize.type = "hidden";	
		maxfilesize.name = "MAX_FILE_SIZE" ;

	
	
		actnode.setAttribute('value',"picsad" );	
		actnode.type = "hidden";	
		actnode.name = "act" ;
	
		picinfo.setAttribute('style',"width:190px;height:50px;margin-top:10px;" );
		picinfo.name = "picinfo" ;
		picinfo.value    = picinfotext ;	
	
		hidennode.setAttribute('value', upload );	
		hidennode.type = "hidden";	
		hidennode.name = "replace" ;
		
		filenode.setAttribute('value',"picwrap" );	
		filenode.onchange = function () {		form.submit();  };
		filenode.type = "file";
		filenode.name = name;
		filenode.id = name;
		filenode.setAttribute('style',"font-size:9px;" );	


		element.appendChild(hidennode);	
		element.appendChild(actnode);			
		element.appendChild(filenode);
		element.appendChild(picinfo);
		element.appendChild(maxfilesize);
			
		
} 	


function FileImputElement2(element,name,upload)
{ 

		var  form  	= document.getElementById('picsform');
	
		var filenode  	   = document.createElement("input");
		var hidennode  		= document.createElement("input");
		var actnode    		= document.createElement("input");
		var maxfilesize     = document.createElement("input");
	
		
			  
		maxfilesize.setAttribute('value', "2097152" );	
		maxfilesize.type = "hidden";	
		maxfilesize.name = "MAX_FILE_SIZE" ;

	
	
		actnode.setAttribute('value',"picsad" );	
		actnode.type = "hidden";	
		actnode.name = "act" ;

		hidennode.setAttribute('value', upload );	
		hidennode.type = "hidden";	
		hidennode.name = "replace" ;
		
		filenode.setAttribute('value',"picwrap" );	
		filenode.onchange = function () {		form.submit();  };
		filenode.type = "file";
		filenode.name = name;
		filenode.id = name;
		filenode.setAttribute('style',"font-size:9px;" );	
		filenode.setAttribute('class',"freplace" );	


		element.appendChild(hidennode);	
		element.appendChild(actnode);			
		element.appendChild(filenode);
		element.appendChild(maxfilesize);
			
		
} 	

function  DoPicPlot(action)
{ 

/*
var divroot	 = document.getElementById('picplot');
		var picnode  = document.createElement("div");
		var newimg  = document.getElementById("first_plot");
			
		picnode.setAttribute('name',"picwrap1"  );
		picnode.setAttribute('class',"picwrap" );
		
		divroot.insertBefore(picnode,divroot.firstChild);
		
		
		CreateForm(picnode);
		newimg.innerHTML = '';
	*/	
//	var divplot = this.parentNode.name;

		var  picdiv  	= document.getElementById('picplot');
	    CreateForm(picdiv , action);
		FileImputElement(picdiv.firstChild,"pimage","new");	
	  


} 


function getCookie(c_name)
{
if (document.cookie.length>0)
  {
  c_start=document.cookie.indexOf(c_name + "=")
  if (c_start!=-1)
    { 
    c_start=c_start + c_name.length+1 
    c_end=document.cookie.indexOf(";",c_start)
    if (c_end==-1) c_end=document.cookie.length
    return unescape(document.cookie.substring(c_start,c_end))
    } 
  }
return ""
}



function setCookie(c_name,value,expiredays)
{
var exdate=new Date()
exdate.setDate(exdate.getDate()+expiredays)
document.cookie=c_name+ "=" +escape(value)+
((expiredays==null) ? "" : ";expires="+exdate.toGMTString())
}


function DoCose(id)
{ 
	
	if(	id == null  || id == "undefine" )
	return ;

	
	$('player' + id ).className = 'player_con_close';
	$('player_button' + id  ).className = 'player_b_open';
	
	
//	 setCookie('window_array',location.hash,365);
	 
	 myhash  =  getCookie('window_array');

	 var str1 =  myhash.slice(0, id);
	 var str2 =  myhash.slice(id, myhash.length);
	 str1 = str1.substr(0,id-1);
	 
			
	 myhash =   str1 + '0' + str2;
	 setCookie('window_array', myhash ,365);
 	
	
} 	

function DoOpen(id)
{
		if(	id == null  || id == "undefine" )
		return ;

		
		$('player' + id ).className = 'player_con_open';
		$('player_button' + id ).className = 'player_b_close';

		
		myhash  =  getCookie('window_array');
		var str1 =  myhash.slice(0, id);
	    var str2 =  myhash.slice(id, myhash.length);
	    str1 = str1.substr(0,id-1);
	 
			
	     myhash =   str1 + '1' + str2;
	
			 
			 
 		     setCookie('window_array',  myhash ,365);
 	
} 	

function InitPlayerWindows()
{
	window_array = '111111';
	setCookie('window_array',window_array ,365);
	



} 	

		




Event.observe(window, 'load', function() {
		
	var URLbits = location.href.split("/");
	var currPage=URLbits[6];
	var nextArg=URLbits[7];
	
	if(nextArg=='photoedit')
	return ;
	
	
	if(nextArg=='contractsedit')
	return ;
	
	
	if(currPage=='players') 
	{ 	
		
		
		window_str  = 	 getCookie('window_array');	
		if (window_str.length>0)
		{ 
		strArray =  window_str.toArray();
	
		 
			for(i=0;i<window_str.length;i++)
			{ 
			 	if(strArray[i]==0)
				DoCose(i+1);
	
			} 

		
		} else { 
		
		InitPlayerWindows();
			
			} 
		
	} 

	
}
);

 function checkEmail(strng) 
 { 
      var x = strng; 
      var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/; 
      if (filter.test(x)) return true; 
      else return false; 
 } 
  
  
 function  SubmitUser()
 { 
 	
	var theForm = $('userform') ;
	
	 var filter = document.createElement("input");
	 var val = 		  $F('filtertype');
		 
	 var filter = document.createElement("input");
	   
		 filter.setAttribute('value', val );	
	  	 filter.type = "hidden";	
		 filter.name = "filtertype";
		 
		 
	
  	var email = $('email').value;	
     if( checkEmail(email) ) 	
	 { 
	 
	 
	   	theForm.appendChild(filter);

		theForm.submit();
	 	return true;
	 }
	  else 
  	 { 
	 
	 	$('email_error').innerHTML = ' Please enter correct email ';
		return false; 
	 } 
  
 } 
  
  
  
  /*************************************************************************************************************/
 