// JavaScript Document

function formSubmit(element)
	{
	document.forms[element].submit();
	}

// Ajax

url = document.location.href;
	xend = url.lastIndexOf("/") + 1;
	var base_url = url.substring(0, xend);
	
	function ajax_do (url) {
			// Does URL begin with http?
			if (url.substring(0, 4) != 'http') {
					url = base_url + url;
			}
	
			// Create new JS element
			var jsel = document.createElement('SCRIPT');
			jsel.type = 'text/javascript';
			jsel.src = url;
	
			// Append JS element (therefore executing the 'AJAX' call)
			document.body.appendChild (jsel);
	}
	function showBigPic(url)
	{
		document.getElementById('bigPic').style.background='url('+ url +') no-repeat center';
	}

 function openWin(link, handler, width, height) {
    window.open(link, handler, 'scrollbars=1, statusbar=1, location=no, width='+width+', height='+height+', ScreenX=100, ScreenY=50');
	}
	
// submit pe enter

	function enterSubmit(evt, f)
	{
		evt = (evt) ? evt : ((window.event) ? window.event : "")
		if(evt && evt.keyCode == 13)
		{
			evt.keyCode = null;
			var form = document.forms[f];
			if(form)
				form.submit();
		}
		
	}
	
	function pict(id)  {openWin('mesaje_img.php?id=' + id,'imagine', '820', '620');}
	function punct(id) {openWin('punctaj.php?id=' + id,'punctaj', '400', '300');}	
	function recom(id) {openWin('recomanda.php?id=' + id,'recomanda', '400', '300');}
	function recomf(id) {openWin('recomandaf.php?id=' + id,'recomandaf', '400', '300');}
	function com(id) {openWin('comenteaza.php?id=' + id,'comenteaza', '400', '300');}

 
  function chat(id) {
	    window.open('chat.php?id=' + id, 'chat' + id , 'resizable=0 , scrollbars=0, status=0, location=no, width=690, height=450');
  }
  
  
  
  	function radio(address) {
		var str  = '<OBJECT ID="WMPlay" classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" width=350 height=390 codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701" type="application/x-oleobject">';
			str += '<param name="url" value="'+ address +'" />';
       	 	str += '  <PARAM name="DisplaySize" value="0" />';
        	str += '  <PARAM NAME="ShowControls" VALUE="1" />';
        	str += '  <PARAM NAME="ShowDisplay" VALUE="0" />';
        	str += '  <PARAM NAME="ShowStatusBar" VALUE="1" />';
        	str += '  <PARAM NAME="AutoStart" VALUE="TRUE" />';
        	str += '  <PARAM NAME="InvokeURLS" Value="False" />';
        	str += '  <PARAM NAME="WindowlessVideo" Value="TRUE" />';
			str += '<embed type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/Downloads/Contents/MediaPlayer/" width="350" height="390" src="'+address+'" name="Club" AutoStart="True" showcontrols="1" ShowStatusBar="1" ShowDisplay="0"></embed>';
			str += '</object>'
		document.write(str);
	}
 

