function MM_openBrWindow(theURL,winName,features)
{
	  window.open(theURL,winName,features);
}	  

function PP_NewsShow(URL)
{

    day = new Date();
    id = day.getTime();
    eval("page" + id + " = window.open(URL, '" + id + "','toolbar=0,scrollbar=0,location=0,statusbar=0,menubar=0,resizable=0,width=400,height=261');");
    }

function SearchEmpty(fm,pm)
{					   
	  // fm = html form
      var srh_field;	  
	  if(pm == 1) srh_field=document.forms[fm].srh_field;
	  if(pm == 2) srh_field=document.forms[fm].srh_forum;		  
	  
	  if(srh_field.value == "enter keyword") srh_field.value = '';				   
	  if(srh_field.value == "enter file ID") srh_field.value = '';				   
	  if(srh_field.value == "search all boards") srh_field.value = '';				   
	  if(srh_field.value == "search this board") srh_field.value = '';				   	  
	  if(srh_field.value == "search threads") srh_field.value = '';				   	  	  
}

function SearchEmptyFaq()
{					   
	  // fm = html form
          var faq_field;	  
	  faq_field=document.searchfaq.faq_field;
	  
	  if(faq_field.value == "your keyword here") faq_field.value = '';				   
}

function SearchSubmit()
{
      var srh_field;
	  var mikExp = /[$\\@\\\#%\^\&\*\(\)\[\]\+\_\{\}\`\~\=\|]/;

	  sh=document.searchfrm.srh_field;
	  if(sh.value.length == 0 || sh.value=="your keyword here" || sh.value=='enter keyword')
	  {
			alert("Please enter a keyword.");		  
			sh.focus();
    		sh.select();
			return false;
	  }
	  if(sh.value.length < 2)
	  {
			alert("Minimum 2 characters required.");		  
			sh.focus();
    		sh.select();
			return false;
	  }	
	  else
	  {
	  if(sh.value.search(mikExp) != -1) 
		{
			alert("Sorry, but the following characters\n\r\n\r@ $ % ^ & * # ( ) [ ] \\ { + } ` ~ =  | \n\r\n\rare not allowed!\n");
			sh.focus();
			sh.select();
			return false;
		}
	  }
	  return;
}

function SearchFaq()
{
      var faq_field;
	  var mikExp = /[$\\@\\\#%\^\&\*\(\)\[\]\+\_\{\}\`\~\=\|]/;

	  sh=document.searchfaq.faq_field;
	  if(sh.value.length == 0 || sh.value=="your keyword here")
	  {
			alert("Please enter a keyword.");		  
			sh.focus();
    		sh.select();
			return false;
	  }
	  if(sh.value.length <= 2)
	  {
			alert("Minimum 3 characters required.");		  
			sh.focus();
    		sh.select();
			return false;
	  }	
	  else
	  {
	  if(sh.value.search(mikExp) != -1) 
		{
			alert("Sorry, but the following characters\n\r\n\r@ $ % ^ & * # ( ) [ ] \\ { + } ` ~ =  | \n\r\n\rare not allowed!\n");
			sh.focus();
			sh.select();
			return false;
		}
	  }
	  return;
}


function SearchForumSubmit(param)
{
      var sh;
	  var mikExp = /[$\\@\\\#%\^\&\*\(\)\[\]\+\_\{\}\`\~\=\|]/;

	  sh=document.forum_srh.srh_forum;
	  if(param == 1) sh_comp = "search all boards";
	  if(param == 2) sh_comp = "search this board";	  
	  if(param == 3) sh_comp = "search threads";	  	  
	  
	  if(sh.value.length == 0 || sh.value==sh_comp)
	  {
			alert("Please enter a keyword.");		  
			sh.focus();
    		sh.select();
			return false;
	  }
	  if(sh.value.length <= 2)
	  {
			alert("Minimum 3 characters required.");		  
			sh.focus();
    		sh.select();
			return false;
	  }	
	  else
	  {
	  if(sh.value.search(mikExp) != -1) 
		{
			alert("Sorry, but the following characters\n\r\n\r@ $ % ^ & * # ( ) [ ] \\ { + } ` ~ =  | \n\r\n\rare not allowed!\n");
			sh.focus();
			sh.select();
			return false;
		}
	  }
	  return;
}

/*schimba patratelul mic de la featured photographers*/ 
function ImgNavigation(link_a,thumb_img_a,title_a,pmic_id,pmic_sl)
{
	if(pmic_id != pmic_sl)
	{
		A = 'pmic_' + pmic_id;
		B = 'pmic_' + pmic_sl;
		document.all['a_feat'].href=link_a;
		document.all['img_feat'].src=thumb_img_a;
		document.all['img_feat'].alt=title_a;
		document.all[A].src='img/sq3.gif';
		document.all[B].src='img/sq2.gif';	
	}	
}	  

function AddCmd(text1) {window.document.frm_forum.message.value = window.document.frm_forum.message.value + text1; }

function AddImage() {
	var image_url = prompt('Enter the full URL or the Dreamstime ID of your image:', 'http://www.');
	if (image_url != null) { AddCmd('[img]' + image_url + '[/img]'); }
}

function AddURL() {
	var link_url = prompt('Enter the full URL of your link :', 'http://www.');
	if (link_url != null) { var link_name = prompt('Enter the TEXT for your link (optional) :', ''); }
	if (link_name == '') { AddCmd('[link=' + link_url + '][/link]'); return; } 
	if (link_url != null) { AddCmd('[link=' + link_url + ']' + link_name + '[/link]'); }
}

function NewsCharacters(field)
{
	var MaxCharacters = 1000;
	if (field.value.length > MaxCharacters)
	{
		alert('Please type maximum '+MaxCharacters+' characters in this field!');
		field.value = field.value.substring(0, MaxCharacters);
	}
}
/*onKeyDown="CharacterCount(this.form.message,this.form.remaining);" onKeyUp="CharacterCount(this.form.news,this.form.remaining);"
function CharacterCount(field,remaining)
{
	var MaxCharacters = 255;
	if (field.value.length > MaxCharacters)
	{
		alert('Please type maximum '+MaxCharacters+' characters in this field!');
		field.value = field.value.substring(0, MaxCharacters);
	}
	else
	{
		remaining.value = MaxCharacters - field.value.length;
	}
}*/

function OMSSearch()
{
      var srh_field;
	  var mikExp = /[$\\@\\\#%\^\&\*\(\)\[\]\+\_\{\}\`\~\=\|]/;

	  sh=document.searchfrm.srh_field;

	  if(sh.value.length > 0 )
	  {	
		  if(sh.value.length <= 2)
		  {
				alert("Minimum 3 characters required.");		  
				sh.focus();
				sh.select();
				return false;
		  }	
		  else
		  {
			  if(sh.value.search(mikExp) != -1) 
				{
					alert("Sorry, but the following characters\n\r\n\r@ $ % ^ & * # ( ) [ ] \\ { + } ` ~ =  | \n\r\n\rare not allowed!\n");
					sh.focus();
					sh.select();
					return false;
				}
		  }
	  } 	
	  return;
}

function chkspell(x)
	{
	window.open('spellchecker.php?strtotest='+x, 'spellchecker', 'width=475,height=300,menubar=no,location=no,resizable=yes,scrollbars=yes,status=no');
	}

function FilterSubmit()
{
      var srh_field;
	  var mikExp = /[$\\@\\\#%\^\&\*\(\)\[\]\+\_\{\}\`\~\=\|]/;

	  sh=document.filterfrm.srchby;
	  if(sh.value.length == 0 || sh.value=="your keyword here")
	  {
			alert("Please enter a keyword.");		  
			sh.focus();
    		sh.select();
			return false;
	  }
	  if(sh.value.length <= 2)
	  {
			alert("Minimum 3 characters required.");		  
			sh.focus();
    		sh.select();
			return false;
	  }	
	  else
	  {
	  if(sh.value.search(mikExp) != -1) 
		{
			alert("Sorry, but the following characters\n\r\n\r@ $ % ^ & * # ( ) [ ] \\ { + } ` ~ =  | \n\r\n\rare not allowed!\n");
			sh.focus();
			sh.select();
			return false;
		}
	  }
	  return;
} 

function copytoclipboard(x)
	{
	clipboardData.setData('Text', x);
	}