
function openme(url2open)
{
	leftVal = screen.width / 2 - 350;
	topVal = 30;

	var WinSettings = "left="+leftVal+",top="+topVal+",width=700,height=500,status=yes,toolbar=no,menubar=no,location=no,scrollbars=yes";
	
	window.open(url2open,null,WinSettings);	
}

	var short_alert = 0;
	function ShortDescCheck()
  {
    val = document.getElementById("tbEO_PropShortDesc").value; 
    
    if (val.length > 110) 
    {
    	if(short_alert == 0)
    	{
        alert('You are over the limit of 110 characters. Please, edit.');
        short_alert = 1;
      }
      //document.getElementById("tbEO_PropShortDesc").value = val.substring(0,110);
      document.getElementById("tbEO_PropShortDesc").focus()
    }
    if((110-parseInt(document.getElementById("tbEO_PropShortDesc").value.length)) >= 0)
    	document.getElementById("tbEO_ShortDescCount").value=110-parseInt(document.getElementById("tbEO_PropShortDesc").value.length);          
    else
    	document.getElementById("tbEO_ShortDescCount").value = "EDIT!";
  }

	var long_alert = 0;  
  function LongDescCheck()
  {
    val = document.getElementById("tbEO_PropLongDesc").value; 
    if (val.length > 800) 
    {
    	if(long_alert == 0)
    	{
        alert('You are over the limit of 800 characters. Please, edit.');
        long_alert = 1;
      }
      //document.getElementById("tbEO_PropLongDesc").value = val.substring(0,800);
      document.getElementById("tbEO_PropLongDesc").focus()
    }
    if(800-parseInt(document.getElementById("tbEO_PropLongDesc").value.length) >= 0)
    	document.getElementById("tbEO_LongDescCount").value=800-parseInt(document.getElementById("tbEO_PropLongDesc").value.length);          
    else
    	document.getElementById("tbEO_LongDescCount").value = "EDIT!";
  }
  
  function CheckDescOnSubmit()
  {
  	if(document.getElementById('tbEO_PropShortDesc').value.length > 110)	
  	{
  		
  	  alert('Your short description field is over the limit of characters you have.');	
  	  return false;
  	}
  	
  	if(document.getElementById('tbEO_PropLongDesc').value.length > 800)	
  	{
  		
  	  alert('Your long description field is over the limit of characters you have.');	
  	  return false;
  	}
  	
  	return true;
  }
  
  var nextHiddenIndex = 3;
  function AddUploadPic()
  {    
  	//str = "<input name=\"tbUploadPics[]\" type=\"file\" class=\"textbox\" style=\"width:280px\">";
  	//alert(str);
  	try
  	{
    	var new_pic = document.createElement("<input name=\"tbUploadPics[]\" type=\"file\" class=\"textbox\" style=\"width:280px\">");       
  	}
  	catch(err)
  	{
  		new_pic = document.createElement('input');
  		new_pic.setAttribute('type','file');
  		new_pic.setAttribute('name','tbUploadPics[]');
  		new_pic.setAttribute('class','textbox');
  		new_pic.setAttribute('style','width:280px');
  	}
  	
    
    var br = document.createElement("BR");
    document.getElementById("tdPics").appendChild(new_pic);
    document.getElementById("tdPics").appendChild(br);
    
    nextHiddenIndex++;
    if(nextHiddenIndex == 10)
    {
      document.getElementById("aAddPic").style.visibility = "hidden";
    }
  }
  
function OpenPic(href)
{
  window.open(href,'_blank','directories=no,fullscreen=no,location=no,menubar=no,resizable=no,scrollbars=no,status=no,titlebar=no,toolbar=no,width=600,height=600,top=50,left=100');        
}

function DisableCtrl(ctrl)
{
	document.getElementById(ctrl).disable = true;	
}



