var win=null;

function NewWindow(mypage,myname,w,h,scroll,pos){
	if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
	if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;}
	else if((pos!="center" && pos!="random") || pos==null){LeftPosition=0;TopPosition=20}
	settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no';

	win=window.open(mypage,myname,settings);
}


var checked=false;
function checkedAllMessages() {
	var aa= document.getElementById('MessageViewMessagesForm');
	 if (checked == false)
          {
           checked = true
          }
        else
          {
          checked = false
          }
	for (var i =0; i < aa.elements.length; i++) 
	{
	 aa.elements[i].checked = checked;
	}
}


function submitForm(formid){
	document.getElementById(formid).submit();
}

function submitPrice(formid)
{
	document.topsearchform.price_from.value = document.smiles_search.sprice_from.value;
	document.topsearchform.price_to.value = document.smiles_search.sprice_to.value;
	document.topsearchform.location.value = document.smiles_search.slocation.value;
	document.topsearchform.postcode.value = document.smiles_search.spostcode.value;
	document.getElementById("topsearchform").submit();	
}

function submitLocation(formid)
{
	document.topsearchform.location.value = document.smiles_search.slocation.value;
	document.topsearchform.postcode.value = document.smiles_search.spostcode.value;
	document.topsearchform.price_from.value = document.smiles_search.sprice_from.value;
	document.topsearchform.price_to.value = document.smiles_search.sprice_to.value;
	//alert(document.smiles_search.sprice_to.value)
	document.getElementById("topsearchform").submit();	
}

function submitPicture(formid)
{
	if(document.smiles_search.spic.checked == true)
	{
		document.topsearchform.pic.checked = true;
		document.topsearchform.location.value = document.smiles_search.slocation.value;
		document.topsearchform.postcode.value = document.smiles_search.spostcode.value;
		document.topsearchform.price_from.value = document.smiles_search.sprice_from.value;
		document.topsearchform.price_to.value = document.smiles_search.sprice_to.value;
		document.getElementById("topsearchform").submit();	
	}
}

function remove_text(id)
{
	//if(id=='fld')
	//{
	document.getElementById('fld').value='';
	//}
}
function restore_text(id)
{
	//if(id=='fld')
	//{
	document.getElementById('fld').value='Search text';
	//}

}
function remove_text_email()
{
	//if(id=='fld')
	//{
	document.getElementById('newsletter_email').value='';
	//}
}

function remove_text_pcode()
{
	//if(id=='fld')
	//{
	document.getElementById('postCode').value='';
	//}
}




