//function GISoost_ref() {
//  if ((get_cookie("gisoost") == "intranet") || (document.referrer.search("intranet") != -1)) {
//    var expdate = new Date();
//    expdate.setTime(expdate.getTime() + (7*24*60*60*1000));
//    document.cookie="gisoost=intranet; expires=" + expdate.toGMTString() + "; domain=www.gisoost.be; path=/;";
//  }
//}

function get_cookie(Name) {
//Get cookie routine by Shelley Powers 
  var search = Name + "="
  var returnvalue = "";
  if (document.cookie.length > 0) {
    offset = document.cookie.indexOf(search)
    // if cookie exists
    if (offset != -1) { 
      offset += search.length
      // set index of beginning of value
      end = document.cookie.indexOf(";", offset);
      // set index of end of cookie value
      if (end == -1) end = document.cookie.length;
      returnvalue=unescape(document.cookie.substring(offset, end))
      }
   }
  return returnvalue;
}

function gisoost_home () {
  if (get_cookie("gisoost") == "intranet")
   {return "http://intranet";}
  else
   {return "http://www.oost-vlaanderen.be";}
}

function mmm_mm_m (n, d, t) {
  document.write('<a href="&#109;&#97;&#105;&#108;&#116;&#111;&#058;');
  document.write(n + '&#64;' + d + '&#46;' + t + '">');
  document.write(n + '&#64;' + d +'&#46;' + t + '</a>');
}

function gisoostmail(){
  mmm_mm_m ("info","gisoost","be");
}


function POVframe() {

document.writeln('<table width="100%">')
document.writeln('<tr>')
document.writeln('<td align="center">')
document.writeln('<A HREF="' + gisoost_home() + '" border=0 target="GISoost"><img src="../pov_images/pov.gif" border=0 alt="Oost-Vlaanderen" height="32"></A>')
document.writeln('<A HREF="http://www.gisoost.be"  border=0 target="GISoost"><img src="../pov_images/gisoost.gif" border=0  alt="GISoost" height="32"></A>')
document.writeln('</td>')
document.writeln('</tr>')
document.writeln('<tr>')
document.writeln('<td align="center">')
document.writeln('<A class="gisoost" HREF="project_info.htm" target="info">&nbsp;Info&nbsp;</A>')
//document.writeln('<A class="gisoost" HREF="project_contact.htm" target="contact">&nbsp;Contact&nbsp;</A>')

var splitted = location.href.substring(22,location.href.indexOf("/",23))
document.writeln('<A class="gisoost" HREF="/home/project_contact.php?project=' + splitted + '" target="GISoost">&nbsp;Contact&nbsp;</A>')

document.writeln('<A class="gisoost" HREF="/help/help.htm" target="help">&nbsp;Help&nbsp;</A>')
document.writeln('<A class="gisoost" HREF="/home/GIS_projecten.php" target="GISoost">&nbsp;Home&nbsp;</A>')
document.writeln('</td>')
document.writeln('</tr>')
document.writeln('</table>')

}

function POV_head() {

document.writeln('<A HREF="' + gisoost_home() + '" border=0 target="_top"><img src="../pov_images/pov.gif" border=0 alt="Oost-Vlaanderen" height=60></A>')
document.writeln('<A HREF="http://www.gisoost.be"  border=0 target="_top"><img src="../pov_images/gisoost.gif" border=0  alt="GISoost" height=60></A>')

}

function contact_top() {

POV_head()

document.writeln('<blockquote>');
document.writeln('<h3>Copyright</h3>');
document.writeln('<P>Deze website en inhoud (o.a. kaartmateriaal) zijn auteursrechtelijk beschermd en kunnen niet zonder toestemming worden verspreid of overgenomen, in welke vorm dan ook. Raadpleeg de <A href="/home/metadata/">metadata</A> voor de specifieke gebruiksvoorwaarden die door de eigenaar of leverancier van de data bepaald werden en respecteer die. Contacteer ons als er nog geen metadata/gebruiksvoorwaarden vermeld zijn.</P>');
}


function contact_bottom() {

  contact_bottom1();
  contact_bottom2();

}

function contact_bottom1() {

document.writeln('<h3>Voor reacties, opmerkingen of vragen:</h3>')

}

function contact_bottom2() {

document.writeln('<P><B>Provinciebestuur Oost-Vlaanderen, Dep. Interne Organisatie, <br>Dienst ICT/GIS-cel</B><br>')
document.writeln('E-mail:')
gisoostmail()
document.writeln('<br>')
document.writeln('Tel: 09-267 77 08<br>')
document.writeln('Fax: 09-267 76 99<br>')
document.writeln('Post: Gouvernementstraat 1, 9000 Gent<br>')
document.writeln('</p>')
document.writeln('<p>')
document.writeln('GISoost homepage: <a href="http://www.gisoost.be" target="_top">www.gisoost.be</a>')
document.writeln('</p>')
//document.writeln('</blockquote>')
}

OtherService = new Array();
OtherName = new Array();

var ii = 0;

OtherService[ii] = "agnas";
OtherName[ii] = "agnas (**)";

ii++;
OtherService[ii] = "atlasbw";
OtherName[ii] = "Atlas van de buurtwegen";

ii++;

OtherService[ii] = "atlaswl";
OtherName[ii] = "Atlas van de waterlopen";

ii++;

OtherService[ii] = "bedr_ter";
OtherName[ii] = "Bedrijventerreinen (**)";

ii++;

OtherService[ii] = "belgie";
OtherName[ii] = "Belgische gemeenten";

ii++;

OtherService[ii] = "beschermingszones";
OtherName[ii] = "Beschermingszones en natuurverbindingen";

ii++;

OtherService[ii] = "bwk";
OtherName[ii] = "BWK";

ii++;

OtherService[ii] = "bos";
OtherName[ii] = "bos (***)";

ii++;

OtherService[ii] = "epom";
OtherName[ii] = "epom";

ii++;

OtherService[ii] = "exoten";
OtherName[ii] = "exoten";

ii++;

OtherService[ii] = "extract";
OtherName[ii] = "extract (**)";

ii++;

OtherService[ii] = "fietsnetwerk";
OtherName[ii] = "Fietsnetwerken";

ii++;

OtherService[ii] = "GRB";
OtherName[ii] = "GRB (*)";

ii++;

OtherService[ii] = "gwp";
OtherName[ii] = "Gewestplan 2002";

ii++;

OtherService[ii] = "gwp2006";
OtherName[ii] = "Gewestplan 2006 (*)";

ii++;

OtherService[ii] = "kadscan";
OtherName[ii] = "Kadscan/Kadvec/cadmap (*)";

ii++;

OtherService[ii] = "kleurenortho";
OtherName[ii] = "Kleurenorthofoto\'s";

ii++;

OtherService[ii] = "kleurentopo";
OtherName[ii] = "Kleurentopokaarten";

ii++;

OtherService[ii] = "molado";
OtherName[ii] = "molado (***)";

ii++;

OtherService[ii] = "mtb";
OtherName[ii] = "mtb (***)";

ii++;

OtherService[ii] = "ortho";
OtherName[ii] = "Orthofoto-archief (*)";

ii++;

OtherService[ii] = "patrimonium";
OtherName[ii] = "patrimonium (***)";

ii++;

OtherService[ii] = "provincie";
OtherName[ii] = "Provincie";

ii++;

OtherService[ii] = "prs";
OtherName[ii] = "PRS";

ii++;

OtherService[ii] = "nogrog";
OtherName[ii] = "Risicozones overstromingen (**)";

ii++;

OtherService[ii] = "rup";
OtherName[ii] = "RUP (***)";

ii++;

OtherService[ii] = "sigma";
OtherName[ii] = "Sigma (**)";

ii++;

OtherService[ii] = "soka";
OtherName[ii] = "Sociale kaart";

ii++;


OtherService[ii] = "stratenplan";
OtherName[ii] = "Stratenplan NavTeq";

ii++;

OtherService[ii] = "stratenplan0";
OtherName[ii] = "Stratenplan Tele Atlas (**)";

ii++;

OtherService[ii] = "TN";
OtherName[ii] = "transportnetwerk (***)";

ii++;

OtherService[ii] = "tov_fiets";
OtherName[ii] = "TOV-Fietsknooppuntennetwerk (*)";

ii++;


OtherService[ii] = "utm";
OtherName[ii] = "UTM uurhokken";

ii++;

OtherService[ii] = "vha";
OtherName[ii] = "VHA";

ii++;

OtherService[ii] = "vlaanderen";
OtherName[ii] = "Vlaanderen";

ii++;

OtherService[ii] = "watertoets";
OtherName[ii] = "watertoets";

//function other_project(SelObj,L,B,R,T) {
//
//	var which=SelObj.options[SelObj.selectedIndex].value
//
//	if (which != "") {	
//	var theUrl = "http://www.gisoost.be/" + which + "/viewer.htm?Box=";
//	theUrl = theUrl + L + ":" + B + ":" + R + ":" + T;
//
//	var win1 = window.open(theUrl,which);
//	win1.focus();
//	window.close();
//	}
//}

function select_projects(t) {

//  var ppos = t.imsURL.indexOf("=");
//  var plen = t.imsURL.length - ppos - 1;
//  var proj = t.imsURL.substr(ppos+1,plen);

  var intranet = (gisoost_home() == "http://intranet");

  document.writeln('<table><tr><td width="50%">');

  for (var i=0, n=OtherName.length;i<n;i++) {
    if ( (OtherName[i].indexOf("**")<0) || intranet ){
      var theUrl = "http://www.gisoost.be/" + OtherService[i] + "?Box=";
      theUrl = theUrl + t.eLeft + ":" + t.eBottom + ":" + t.eRight + ":" + t.eTop;
      document.writeln('<a href="' + theUrl + '" target="' + OtherService[i] + '">' + OtherName[i] + '</a><br>');
    }	
  }


//  document.writeln('<select onChange="other_project(this,' + t.eLeft + ',' + t.eBottom + ',' + t.eRight + ',' + t.eTop +')" size="' + (OtherName.length - 1) + '">');
//
//  for (var i=0, n=OtherName.length;i<n;i++) {
//    if ( (proj != OtherService[i]) && ((OtherName[i].indexOf("**")<0) || intranet) ){
//        document.writeln('<option value="' + OtherService[i] + '">');
//        document.writeln(OtherName[i] + '</option>');
//    }	
//  }
//  document.writeln('</select>');

  document.writeln('</td>');
  document.writeln('<td valign="top">');

  document.writeln('<P>Bij het selecteren van een project uit deze lijst zal dit project in een nieuw venster opstarten met hetzelfde gebied als het oorspronkelijke project.');
  document.writeln('<BR><BR>');
  document.writeln('(*) enkel intra- en extranet');
  document.writeln('<BR>');	
  if (intranet) document.writeln('(**) enkel intranet');
  document.writeln('</P>');	

  document.writeln('<table>');
  document.writeln('<tr><td colspan="2"><B>Grenzen:</B></td></tr>');
  document.writeln('<tr><td>xmin:</td><td>' + Math.round(t.eLeft) + '</td></tr>');
  document.writeln('<tr><td>xmax:</td><td>' + Math.round(t.eRight) + '</td></tr>');
  document.writeln('<tr><td>ymin:</td><td>' + Math.round(t.eBottom) + '</td></tr>');
  document.writeln('<tr><td>ymax:</td><td>' + Math.round(t.eTop) + '</td></tr>');
  document.writeln('<tr><td colspan="2"><B>Midden:</B></td></tr>');
  document.writeln('<tr><td>x:</td><td>' + Math.round(t.eLeft+(t.eRight-t.eLeft)/2) + '</td></tr>');
  document.writeln('<tr><td>y:</td><td>' + Math.round(t.eBottom+(t.eTop-t.eBottom)/2) + '</td></tr>');
  document.writeln('</table>');

  document.writeln('</td></tr></table>');


}
