var siteheading="";
var pageheading="";
var pagesubheading="";
var sitefooter="Best Viewed with 800x600 Resolution";
var autoclose=true;

//check browser type
var ie4 = (document.all)?true:false;
var browvar= navigator.userAgent
if (browvar.indexOf("Firefox")!=-1)
{
  ie4=true;
}
var ns4 = (document.layers)?true:false;

// move to login page if not logged
function move2page()
{
	location.href="index.html";
}

function move2homepage()
{
	location.href="/default.asp";
}

function go2page(pagename)
{
	location.href=pagename;
}



function loadCss()
{
	if(ie4)
	{
		out("<link REL='stylesheet' TYPE='text/css' HREF='/netorgysie.css'>");
	}
	else
	{

		out("<link REL='stylesheet' TYPE='text/css' HREF='/netorgysnn.css'>");
	}	
}


function topTable()
{

	document.write("<div align='center'><center>")
	document.write("<table border='0' align='center' width='750'cellpadding='0' cellspacing='0'>");

	document.write("<tr><td valign='top' align='center' width='750'>");
	
	
	document.write("<p class='heading1'>R.VENKATACHALAM.");
	document.write("<p class='heading5'>Internet Consultancy, Website Development, EMarketing, Training</p>");
	document.write("<p class='heading6'>Phone: +91-44-24640793 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Email: <a class='heading6' href='/contactrvenkatachalam.html'>contact@RVenkatachalam.com</a></p>");
	
	

	document.write("</td>")

	
	document.write("</tr>");
	document.write("</table>");
	document.write("</center></div>")
//	}
	displayOfferImage();
	
}

function pageStartup()
{
var murl=location.href;
var indasp=murl.indexOf(".asp");

if (indasp == -1)
{		
 	noteSource();
}
else
{

    if (!cookiePresent("hitpage")) 
    {
      if (document.referrer.length==0)
     	{
	   setCookie("hitpage","DIRECT");	
	    }
      else
         setCookie("hitpage",document.referrer);
    }
}

}

//********offer image generation code
function displayOfferImage()
{
	var doctitle=document.title;
	if(doctitle.match("Special Offer","i") == null)
	{
	  if(cookiePresent("offerpage")&& cookiePresent("offerimage"))
	  {

document.write("<table border='0' align='right' cellpadding='0' cellspacing='0'>");

		document.write("<tr><td align='right'>");
		opage=getCookieValue("offerpage");
		oimage=getCookieValue("offerimage");
		opagearr=opage.split("#");
		oimagearr=oimage.split("#");
		var olen=opagearr.length;

		for(i=0; i<olen; i++)
	      {
			document.write("<a href=/offer/"+opagearr[i]+"><img border='0' src=/images/"+oimagearr[i]+" alt="+oimagearr[i]+" vspace='0' hspace='0'></a>");
            } //end of for	
		document.write("</td></tr>");
		document.write("</table><br><br><br>");

       }
	
    }//end of var doctitle  check

}  //end of displayOfferImage()

//*******  end of offer image generation code

function out(str)
{
	document.write(str);
}

function isonnet()
{
	  var host=location.hostname;
	  // document.write("You are running under"+host);
  
  	if (host!="localhost")
	  { 
		    return true;
	     }
	  else
	   {
		    return false;
            }
 }

function isAdminLogged()
{
	if(getCookieValue("loginname")=="ADMIN")
	{
		return true;
	}
	else
	{
		return false;
	}
}

function noteSource()
{


   var srcpage="";
	if(cookiePresent("notesource"))
	{

		return true;
	}
	else
        {
		// if hitpage cookie is on get referrer from there otherwise regular referrer
		if ( cookiePresent("hitpage"))
		{
		  srcpage=getCookieValue("hitpage");

		}
		else
		{ 
			srcpage=document.referrer; 
		}


            document.write("<form name='srcform' method='post' action='/ns.asp'>");
            document.write("<input type='hidden' name='targetpage' value='"+location.href +"'>"); 
		 if(srcpage!="")
                {
			document.write("<input type='hidden' name='spage' value='"+srcpage+"'>"); 
		    }
			else
			{
			document.write("<input type='hidden' name='spage' value='DIRECT'>"); 

			}
		document.write("</form>"); 
		document.srcform.submit();
            
               
		return false;
        }
}

function showSiteHeader()
{
	document.write("<p class='siteheader'>"+siteheading+"</p>");
}

function showPageHeader()
{
      if (cookiePresent("loginemail")) 
	{   
	document.write("<table><tr><td width='350'><font style='{font-size:18px; color:green;}'>Login: " + getCookieValue("loginemail")+ "</font></td>");
      document.write("<td width='350' align='right'><a href='logout.asp'>Logout here </a></td></tr></table>");
	}

	document.write("<p class='pageheading'>"+pageheading+"</p>");
}

function showPageSubHeader()
{
	document.write("<p class='pagesubheading'>"+pagesubheading+"</p>");
}

function gotoPage(strloc)
{
	location.href=strloc;
}

function goHome()
{
	location.href="default.asp";
}

function writeOfferLinks()
{
document.write("<table align='center' border='1' cellpadding='0' cellspacing='0'>");
document.write("<tr>");

document.write("<td width='125' align='center' valign='top' class='tdheadingcenter'>");
document.write("<a class='tdheadingcenter' href=javascript:gotoPage('listoffer.asp')>LIST</a></td>");

document.write("<td width='125' align='center' valign='top' class='tdheadingcenter'>");
document.write("<a class='tdheadingcenter' href=javascript:gotoPage('addoffer.html')>ADD</a></td>");

document.write("<td width='125' align='center' valign='top' class='tdheadingcenter'>");
document.write("<a class='tdheadingcenter' href=javascript:gotoPage('modifyoffer.html')>MODIFY</a></td>");

document.write("<td width='125' align='center' valign='top' class='tdheadingcenter'>");
document.write("<a class='tdheadingcenter' href=javascript:gotoPage('deleteoffer.html')>DELETE</a></td>");

document.write("<td width='125' align='center' valign='top' class='tdheadingcenter'>");
document.write("<a class='tdheadingcenter' href=javascript:gotoPage('reportvalidoffers.asp')>VALID OFFERS</a></td>");

document.write("<td width='125' align='center' valign='top' class='tdheadingcenter'>");
document.write("<a class='tdheadingcenter' href=javascript:gotoPage('reporthighrespoffers.asp')>HIGH RESPONSES</a></td>");

document.write("<td width='125' align='center' valign='top' class='tdheadingcenter'>");
document.write("<a class='tdheadingcenter' href=javascript:gotoPage('reportlowrespoffers.asp')>LOW RESPONSES</a></td>");

document.write("<td width='125' align='center' valign='top' class='tdheadingcenter'>");
document.write("<a class='tdheadingcenter' href=javascript:gotoPage('selectofferezine.asp')>DESPATCH OFFER EZINES</a></td>");

document.write("<td width='125' align='center' valign='top' class='tdheadingcenter'>");
document.write("<a class='tdheadingcenter' href=javascript:gotoPage('selectoffer2extend.asp')>EXTEND OFFER</a></td>");

document.write("<td width='125' align='center' valign='top' class='tdheadingcenter'>");
document.write("<a class='tdheadingcenter' href=javascript:gotoPage('/admin/admincp.asp')>MAIN PANEL</a></td>");

document.write("</tr></table>");
}

function writeOfferAdminLink()
{
        if(isAdminLogged() )
                document.write("<p class=tdtext> <a class=pagelink href=javascript:gotoPage('offercontrolpanel.html')>Offer Control Panel</a></p>");
}

function dispText(num)
{

	switch(num)
	{
            case 1:
			window.status="Internet Consultancy";
			break;
		case 2:
			window.status="Website Development";
			break;
            case 3:
			window.status="EMarketing";
			break;
            case 4:
		window.status="Training";
		break;

		case 5:
		window.status="Service Charges";
		break;
		
		case 6:
		window.status="Downloads";
		break;
		
		case 7:
		window.status="Home Page";
		break;
                 
            case 8:
		window.status="Refer RV";
		break;

            case 9:
		window.status="Participate in Online Quiz";
		break;

	    case 10:
		window.status="Order Online";
		break;
            case 11:
		window.status="Software Development";
		break;
            case 12:
		window.status="Books, CBT Development";
		break;

            case 13:
		window.status="Business Consultancy";
		break;
            case 0:
		window.status="";
		break;
		default :
		window.status="RVenkatachalam.com- Internet Consultant";
	}
}


function writeRightLinks()
{
var extracode="";

   extracode="<br>";

document.write("<a class='rightlinks' href='/internetconsultancy.html' onMouseOver='dispText(1);return true;' onMouseOut='dispText(0);return true;'><img src='/images/ic.gif' border='0' align='absmiddle' hspace='5' alt='Internet Consultancy'></a><br>"+extracode);

document.write("<a class='rightlinks' href='/websitedesigning.html' onMouseOver='dispText(2);return true;' onMouseOut='dispText(0);return true;'><img src='/images/webdev.gif' border='0' align='absmiddle' hspace='5' alt='Website Development'></a><br>"+extracode);

document.write("<a class='rightlinks' href='/emarketing.html' onMouseOver='dispText(3);return true;' onMouseOut='dispText(0);return true;'><img src='/images/emark.gif' border='0' align='absmiddle' hspace='5' alt='E-Marketing'></a><br>"+extracode); 

document.write("<a class='rightlinks' href='/training.html' onMouseOver='dispText(4);return true;' onMouseOut='dispText(0);return true;'><img src='/images/train.gif' border='0' align='absmiddle' hspace='5' alt='Training'></a><br>"+extracode);

document.write("<a class='rightlinks' href='/softwaredevelopment.html' onMouseOver='dispText(11);return true;' onMouseOut='dispText(0);return true;'><img src='/images/software.gif' border='0' align='absmiddle' hspace='5' alt='Software Development'></a><br>"+extracode);

document.write("<a class='rightlinks' href='/learningmaterialdevelopment.html' onMouseOver='dispText(12);return true;' onMouseOut='dispText(0);return true;'><img src='/images/learningmaterial.gif' border='0' align='absmiddle' hspace='5' alt='Books,CBT Development'></a><br>"+extracode);

document.write("<a class='rightlinks' href='/servicecharges.html' onMouseOver='dispText(5);return true;' onMouseOut='dispText(0);return true;'><img src='/images/serch.gif' border='0' align='absmiddle' hspace='5' alt='Service Charges'></a><br>"+extracode);

document.write("<a class='rightlinks' href='/free-ebook-business-website.asp'><img src='/images/free-ebook.gif' border='0' align='absmiddle' hspace='5' title='Free ebook business website' alt='Free ebook business website'></a><br>");

}


function bottomTable()
{
	
	//document.write("<hr align='left' width='750' size='3' color='#8d8d72' noshade>");
	document.write("<br><div  float='none'>")
	document.write("<table float='none' class='footertable' cellpadding='0' cellspacing='0' width='750' border='0'>");
	document.write("<tr>");

	document.write("<td class='pagefooter' align='center' valign='top' width='100'>");
		document.write("<a class='pagefooter' href='/default.asp'>HOME</a>");
	document.write("</td>")

	document.write("<td class='pagefooter' align='center' valign='top' width='100'>");
		document.write("<a class='pagefooter' href='/aboutrvenkatachalam.html'>ABOUT</a>");
	document.write("</td>")

	document.write("<td class='pagefooter' align='center' valign='top' width='100'>");
		document.write("<a class='pagefooter' href='/faq.html'>FAQ</a>");
	document.write("</td>")

	document.write("<td class='pagefooter' align='center' valign='top' width='100'>");
		document.write("<a class='pagefooter' href='/terms.html'>TERMS</a>");
	document.write("</td>");

	document.write("<td class='pagefooter' align='center' valign='top' width='120'>");
		document.write("<a class='pagefooter' href='/policy.html'>POLICY</a>");
	document.write("</td>")

	document.write("<td class='pagefooter' align='center' valign='top' width='100'>");
		document.write("<a class='pagefooter' href='/contactrvenkatachalam.html'>CONTACT ME</a>");
	document.write("</td>")

	document.write("</tr>");

	document.write("</table>");
	document.write("</div><br>")

}


function showSiteFooter()
{
 document.write("<div  float='none'>")	
 document.write("<table float='none' border='0'  width='750' cellpadding='0' cellspacing='0'>");
 document.write("<tr><td valign='top' width='750'  class='addressband'>");
  document.write("Address : 183, Vinayaga Nagar, Kutchery Road, Mylapore, Chennai 600004.<br>");
  document.write("Phone : 044-24640793&nbsp;&nbsp;&nbsp; <br><br><br>"); 
document.write(sitefooter);
 document.write("</td>")
 document.write("</tr>");
 document.write("</table>");
 document.write("</div><br>")

//  document.write("<p class='sitefooter'>"+sitefooter+"</p>");
 
	
}

function pageShutdown()
{
   
}

function add2vpages( mpagenum)
{
   //  sdfsdf
var cv="";
  if (cookiePresent("vpages") )
  {
    cv=getCookieValue("vpages");
 }
  
   if (mpagenum >0  )
  {
   cv = cv + "," + mpagenum
   setCookie( "vpages", cv );
  }
}

//////############################   COOKIES FUNCTIONS  ############################////////

// adds a page code in a cookie called "pagevist"
function addvisit(value)
{
  var pv="";
  pv=getCookieValue("pagevisit");
  if (pv==null) 
  {
   pv="";
  }
  if (pv.indexOf(value)==-1)
  {
    pv=pv + value+ "#";
    setCookie("pagevisit", pv);
  }
   
}

function setCookie(name,value)
{
	  var svalue=""+value;	
	  if(svalue.length >0)
	  {		
        document.cookie=name+ "=" + value + ";path=";
	  }
}	

function getCookieValue(name)
{
	var contents=document.cookie;

	var i=contents.indexOf(name);
    	if (i==-1) return null;
    var ch=contents.charAt(name.length+i) 
    if (ch!="=") return null; 
	var start=contents.indexOf("=",i)+1;
	var end=contents.indexOf(";",start);
	if(end==-1) end=contents.length;
	var value=contents.substring(start,end);
	return unescape(value);
}
function cookiePresent(strcookie)
{
	var v=getCookieValue(strcookie);
      	if(v!="***" && v!=null)
		return true;
	return false;
}
function clearCookies()
{
	setCookie("loginname","***");
	/*setCookie("addressing","***");
	setCookie("logcount","***");
	setCookie("RImage","***");
	setCookie("RPage","***");
	setCookie("notesource","***");*/
}

function clearCookie(cookiename)
{
   setCookie(cookiename,"***");
}
function isLogged()
{
	if(cookiePresent("loginname"))
		return true;
	else
		return false;
	  
}
/////////////// ################## END OF COOKIES FUNCTIONS #################### //////////


function showtip(current,e,text,aname)
{
	var a=aname;
   if (document.all)
   {
      themsg=text.split('~')
      if (themsg.length > 1)
      {
        themsgs="";
        for (i=0; i<themsg.length; i++)
           themsgs += themsg[i]+"\n"
        current.title = themsgs
      }
      else current.title = text
   }

   else if (document.layers)
   {
	var incr=20;
	var posx;
	var posy;
    	//var a=anch;
    	var stxt="";
      	
    themsg=text.split('~')
      if (themsg.length > 1)
      {
        themsgs="";
        for (i=0; i<themsg.length; i++)
           themsgs += themsg[i]+"<br>"
        stxt = themsgs;
      }
      else 
      	stxt = text;

	for(i=0;i<document.anchors.length; i++)
		{
			//alert(document.anchors[i].name);		
			if(document.anchors[i].name==a)
			{
				var ax=document.anchors[i].x;
				 var ay=document.anchors[i].y;	
				posx=ax+incr;
				posy=ay+incr;
				//alert(window.innerHeight);
				if((window.innerHeight-ay)<40)
				{
					posy=ay-incr;	
				}
				
			}
		}
	e.pageX=posx;
	e.pageY=posy;
       document.tooltip.document.write(
           '<layer bgColor="#FFFFE7" z-index="1" style="border:1px ' +
           'solid black; font-size:12px;color:#000000;">' + stxt + '</layer>')
       document.tooltip.document.close()

     // alert(window.innerHeight-e.pageX);

      document.tooltip.left=e.pageX;
     // document.tooltip.left=posx;

      document.tooltip.top=e.pageY;
     //document.tooltip.top=posy;
       document.tooltip.visibility="show"
   }
}

function hidetip()
{
    if (document.layers)
        document.tooltip.visibility="hidden"
}

function debug(msg)
{
 if (cookiePresent("debugcookie"))
  {
      alert(msg)
  }
}     

function checkradiobutton(rbobj)
{
      var rcheck=false;
		for(i=0;i<rbobj.length; i++)
  		{
            	if(rbobj[i].checked==true)
			{
				rcheck=true;
				break;
                  }
  		}	
      return rcheck; 
}


function setRadioButton(radioset, mvalue)
{
   for(i=0; i<radioset.length; i++)
	{
		if(radioset[i].value==mvalue)
		{
			radioset[i].checked=true;
		}
	}
}

function setOption(optionset,astr)
{

	for(i=0; i<optionset.options.length; i++)
	{
		if(optionset.options[i].value==astr)
		{
			optionset.options[i].selected=true;
		}
	}
}
// checks whether an option list is selected properly


function setCheckBox(fobj,aval)
{
	if(aval=="Y")
	{
		fobj.checked=true;
	}
	
}

// assuming the list has 'Select option' as first option
function checkOption(optionset)
{
   var validchoice=false;
   
   for(i=1; i<optionset.options.length; i++)
	{
		if(optionset.options[i].selected==true )
		    validchoice=true;
	}
    return validchoice;
}



var cururl=document.location.href;

if (cururl.indexOf(".asp") == -1 && cururl.indexOf("/admin") != -1  && cururl.indexOf("/admin/index") == -1)
{
   if (!isAdminLogged()) 
   {
 		alert("You have to login as admin");
		location.href="/default.asp";
   }
}

function createrempop()
{
if (!cookiePresent("purposenoted") && cookiePresent("notesource"))
{
   var remcontent="";
   if (ie4)
   { 
   remcontent="<table border='0' cellpadding='3' cellspacing='0' bgcolor='#DDDD00'>"
  remcontent=remcontent+ "<tr>"
  remcontent=remcontent+ "<td width='100%' bgcolor='#AAAA00' align='center'>&nbsp;"
  remcontent=remcontent+ "<font color='#FFFFFF'><b>&nbsp;MAY&nbsp; I&nbsp; KNOW&nbsp; YOU ?</b></font></td>"
  remcontent=remcontent+ "</tr>"
  remcontent=remcontent+ "<tr>"
  remcontent=remcontent+ "<td>"
  remcontent=remcontent+ "<form style='margin:0px' name='popform' method='POST' action='saveremdata.asp' onsubmit='return false'>"
  remcontent=remcontent+ "<b>I can respond faster if <br> you will fill this form.</b><br>"
  remcontent=remcontent+ "<b>Name</b><input type='radio' name='remgender' value='M' onfocus='autoclose=false'><b>Mr.</b>"
  remcontent=remcontent+ "<input type='radio' name='remgender' value='F' onfocus='autoclose=false'><b>Ms.</b>"
  remcontent=remcontent+ "<input type='text' name='remname' size='10' onfocus='autoclose=false'><br>" 
  remcontent=remcontent+ "<b>Email</b> <input type='text' name='rememail' size='10' onfocus='autoclose=false'>"
  remcontent=remcontent+ "&nbsp;<b>Phone</b> <input type='text' name='remphone' size='10' onfocus='autoclose=false'><br>"
  remcontent=remcontent+ "<b>Purpose of Visit</b><br> <textarea rows='4' name='rempurpose' cols='30' onfocus='autoclose=false'></textarea><br>"
  remcontent=remcontent+ "<center><input type='button' value='Submit' onclick='submitiepopup()' name='subbut'></center>"
  remcontent=remcontent+ "<input type='hidden' name='srcurl' value='" +  location.href  + "'>"
  remcontent=remcontent+ "</form>"
  remcontent=remcontent+ "<p><i>This popup will close in 10 secs if you don't type.</i></p></td>"
  remcontent=remcontent+ "</tr></table>"
  document.write("<div id='irempop' style='position:absolute; left:450px;top:20px;visibility:hidden'>")
  document.write("</div>")
//  irempop.style.pixelLeft=20; 
 // irempop.style.pixelTop=20;
  irempop.style.pixelWidth=280;
  irempop.style.pixelHeight=200;
  irempop.innerHTML=remcontent;
   }

   if (ns4)
   {
    remcontent="<table border='0' cellpadding='3' cellspacing='0' bgcolor='#DDDD00'>"
  remcontent=remcontent+ "<tr><td width='100%' bgcolor='#AAAA00' align='center'>&nbsp;"
  remcontent=remcontent+ "<font color='#FFFFFF'><b>&nbsp;MAY&nbsp; I&nbsp; KNOW&nbsp; YOU ?</b></font></td>"
   remcontent=remcontent+ "</tr><tr><td>"

  remcontent=remcontent+ "<form name='popform' method='POST' action='saveremdata.asp' onsubmit='return false'>"
   remcontent=remcontent+ "<b>We can respond faster if <br> you will fill this form.</b><br>"
   remcontent=remcontent+ "Name <input type='radio' name='remgender' value='M' onfocus='autoclose=false'>Mr."
  remcontent=remcontent+ "<input type='radio' name='remgender' value='F' onfocus='autoclose=false'>Ms."
  remcontent=remcontent+ "<input type='text' name='remname' size='5' onfocus='autoclose=false'><br>" 
  remcontent=remcontent+ "Email <input type='text' name='rememail' size='5' onfocus='autoclose=false'>"
  remcontent=remcontent+ "&nbsp;Phone <input type='text' name='remphone' size='5' onfocus='autoclose=false'><br>"
  remcontent=remcontent+ "Purpose of Visit<br> <textarea rows='4' name='rempurpose' cols='20' onfocus='autoclose=false'></textarea><br>"
    remcontent=remcontent+ "<center><input type='button' value='Send to RV' onclick='submitnspopup()' name='subbut'></center>"
  remcontent=remcontent+ "<input type='hidden' name='srcurl' value='" +  location.href  + "'>"
  remcontent=remcontent+ "</form>"
  remcontent=remcontent+ "<p><i>This popup will close by itself if you do not type.</i></p></td>"
  remcontent=remcontent+ "</tr>"
  remcontent=remcontent+ "</table>"
    document.write("<layer visibility='hide' width=310 height=200 left=400 top=20 name=\"nrempopup\">")
    document.write(remcontent); 
    document.write("</layer>");    
  }
  
   setTimeout("invokerempop()",5000);

}
}

function invokerempop()
{
    if (ie4)
    {
      irempop.style.visibility="visible";
    }
    if (ns4)
    {
      document.nrempopup.visibility="show";
    }
     setTimeout("closerempop()",10000);
}

function closerempop()
{
 if (autoclose==true) 
    { 
      if (ie4)
      {
        irempop.style.visibility="hidden";   
      }
      if (ns4)
      {
        document.nrempopup.visibility="hide";
      }
   }
}   

function submitiepopup()
{
   if (validatediepopup())
   {
        document.popform.submit();
   }
}  

function submitnspopup()
{
   if (validatednspopup())
   { 
        document.nrempopup.document.popform.submit();
   }
}  


function validatediepopup()
{
	var subname=document.popform.remname.value;
	var subemail=document.popform.rememail.value;		
	var subphone=document.popform.remphone.value;		
	var subpurpose=document.popform.rempurpose.value;		
				
	var namestr=validName(subname);
	var mailstr=validEmail(subemail);
	var phnstr=validPhone(subphone);
	var purposestr=validgeneralmemo(subpurpose,false);

 	if(!(checkradiobutton(document.popform.remgender)))
	{
		alert("Please select your gender");
	        document.popform.remgender[0].focus();
		return false;
	}
		
	if(namestr!="OK")
	{
		alert(namestr);
		document.popform.remname.focus();
		return false;
	}
	if(mailstr!="OK")
	{
		alert(mailstr);
		document.popform.rememail.focus();
		return false;
	}
	if(phnstr!="OK")
	{
		alert(phnstr);
		document.popform.remphone.focus();
		return false;
	}
        if(purposestr!="OK")
	{
		alert("Purpose " + purposestr);
		document.popform.rempurpose.focus();
		return false;
	}

       return true;
}


function validatednspopup()
{
	var subname=document.nrempopup.document.popform.remname.value;
	var subemail=document.nrempopup.document.popform.rememail.value;		
	var subphone=document.nrempopup.document.popform.remphone.value;		
	var subpurpose=document.nrempopup.document.popform.rempurpose.value;		
				
	var namestr=validName(subname);
	var mailstr=validEmail(subemail);
	var phnstr=validPhone(subphone);
	var purposestr=validgeneralmemo(subpurpose,false);

 	if(!(checkradiobutton(document.nrempopup.document.popform.remgender)))
	{
		alert("Please select your gender");
	        document.nrempopup.document.popform.remgender[0].focus();
		return false;
	}
		
	if(namestr!="OK")
	{
		alert(namestr);
		document.nrempopup.document.popform.remname.focus();
		return false;
	}
	if(mailstr!="OK")
	{
		alert(mailstr);
		document.nrempopup.document.popform.rememail.focus();
		return false;
	}
	if(phnstr!="OK")
	{
		alert(phnstr);
		document.nrempopup.document.popform.remphone.focus();
		return false;
	}
        if(purposestr!="OK")
	{
		alert("Purpose " + purposestr);
		document.nrempopup.document.popform.rempurpose.focus();
		return false;
	}

       return true;
}
