function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
  
}

function MM_show_helpus()
{
//generate the "help us" table on the document
i=0;
if (i==0)
{
strVote_Helpful="Helpful";
strVote_NotHelpful="Not helpful";
strVote_DoesNotApply="Does not apply";

document.writeln("<ul>");
document.writeln("<li><a href=javascript:onClick=MM_Vote('http://www.limerickcity.ie/applications/general/vote_helpus.aspx?document='+mm_GetDocName()+'&Vote='+strVote_Helpful,'map','status=no,toolbar=no,menubar=no,location=no,height=600,width=600,scrollbar=yes')>was helpful</a></li>");
document.writeln("<li><a href=javascript:onClick=MM_Vote('http://www.limerickcity.ie/applications/general/vote_helpus.aspx?document='+mm_GetDocName()+'&Vote='+strVote_NotHelpful,'map','status=no,toolbar=no,menubar=no,location=no,height=600,width=600')>was <b>not</b> helpful</a></li>");
document.writeln("<li><a href=javascript:onClick=MM_Vote('http://www.limerickcity.ie/applications/general/vote_helpus.aspx?document='+mm_GetDocName()+'&Vote='+strVote_DoesNotApply,'map','status=no,toolbar=no,menubar=no,location=no,height=600,width=600')>does not apply</a></li>");
document.writeln("</ul>");
}
}

function mm_GetDocName()
{
	//k=document.URL.lastIndexOf('/');
	//i=document.URL.lastIndexOf('.');
	//dc=document.URL.substr(k+1,i+4)
	dc=document.URL;
	return dc;
}


function MM_show_thankyou()
{
//generate the "Thank you!" table on the document
document.writeln("<p>Thank You!</p>");
}

function MM_Vote(myURL,myWinName,myFeatures)
{
document.cookie = document.URL+"_helpUsVoted=1";
MM_openBrWindow(myURL,myWinName,myFeatures);
document.location.reload();
}

function GetCookie(sName)
{
	sName=document.URL+"_"+sName;
  // cookies are separated by semicolons
  //alert(document.title);
  //alert(document.cookie);
    var aCookie = document.cookie.split("; ");
  for (var i=0; i < aCookie.length; i++)
  {
    // a name/value pair (a crumb) is separated by an equal sign
    var aCrumb = aCookie[i].split("=");
    if (sName == aCrumb[0]) 
      return unescape(aCrumb[1]);
  }

  // a cookie with the requested name does not exist
  return null;
}


function MM_show_Survey()
{
//generate the "help us" table on the document
i=0;
if (i==0)
{
strVote_Helpful="Yes";
strVote_NotHelpful="No";
strVote_DoesNotApply="";

document.writeln("\n<BR><p align=center >");
document.writeln("<table cellpadding=0 cellspacing=0 border=0");
document.writeln("	<tr>");
document.writeln("		<td width=5 height=5 bgcolor=#ff6600><img src='graphics/utils/rc_topl.gif' width=5 height=5></TD>");
document.writeln("		<td width=100 height=5 bgcolor=#ff6600></TD>");
document.writeln("		<td width=5 height=5 bgcolor=#ff6600><img src='graphics/utils/rc_topr.gif' width=5 height=5></TD>");
document.writeln("	</tr>");
document.writeln("	<tr>");
document.writeln("		<td class=maintextbw colspan=3 bgcolor=#ff6600 align=center valign=top><b>Survey</b></TD>");
document.writeln("	</tr>");
document.writeln("	<tr><td class=maintext colspan=3 bgcolor=#9ecffe valign=middle allign=center><b>&nbsp;Do you agree<BR>with the City's<BR>Boundary<BR>Extension?</b><BR></TD></TR>");
document.writeln("	<tr>");
document.writeln("		<td colspan=3 bgcolor=#9ecffe class=maintext>");
document.writeln("			&nbsp;&nbsp;<font color=#ff6600>&#149;</font>");
document.writeln("			<a class=maintext href=webapps/survey/survey.aspx?AnswerID=1><b>YES<b></a>");
document.writeln("			<BR>");
document.writeln("			&nbsp;&nbsp;<font color=#ff6600>&#149;</font>");
document.writeln("			<a class=maintext href=webapps/survey/survey.aspx?AnswerID=2><b>No</b></a>");
document.writeln("			<BR>");
document.writeln("			<BR>");
document.writeln("		</td>");
document.writeln("	</tr>");
document.writeln("	<tr>");
document.writeln("		<td width=5 height=8 bgcolor=#9ecffe valign=bottom align=left><img src=graphics/utils/rc_botl.gif width=5 height=5></td>");
document.writeln("		<td width=100 height=8 bgcolor=#9ecffe></td>");
document.writeln("		<td width=5 height=8 bgcolor=#9ecffe valign=bottom align=right><img src=graphics/utils/rc_botr.gif width=5 height=5></td>");
document.writeln("	</tr>");									
document.writeln("</table>");
}
}
