function openwindow(theurl,thewidth) {
if (thewidth == '') {
window.open(theurl,"my_new_window","toolbar=yes,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=yes,width=450,height=400")
}
if (thewidth == 'S') {
window.open(theurl,"my_new_window","toolbar=yes,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=yes,width=350,height=300")
}

if (thewidth == 'L') {
window.open(theurl,"my_new_window","toolbar=yes,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=yes,width=575,height=525")
}


}

function NewLansaWindow(proc,func) {
document.LANSA.target="my_new_window";
window.open(theurl,"my_new_window","toolbar=yes,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=yes,width=575,height=450");
HandleEvent(proc,func);


}

function setAN11CIT(city){
	if(document.LANSA.AN11CIT == undefined){
		newInput = document.createElement("input");
		newInput.setAttribute("type", "hidden");
		newInput.setAttribute("name", "AN11CIT");
		newInput.setAttribute("value", city);
		document.LANSA.appendChild(newInput);
	}else {
		document.LANSA.AN11CIT.value = city;
	}
}

function HandleHRS(COMPANY, CITY) {
document.LANSA.SY30CNO.value=COMPANY;

setAN11CIT(CITY);

document.LANSA.AHRSFLG.value = 'Y';
//HandleCity(COMPANY, CITY);
HandleEvent('JC10WEB','JC11V81');
}


// Script Source: CodeLifter.com
// Copyright 2003
// Do not remove this header

isIE=document.all;
isNN=!document.all&&document.getElementById;
isN4=document.layers;
isHot=false;

function ddInit(e){
  topDog=isIE ? "BODY" : "HTML";
  whichDog=isIE ? document.all.theLayer : document.getElementById("theLayer");
  hotDog=isIE ? event.srcElement : e.target;
  while (hotDog.id!="titleBar"&&hotDog.tagName!=topDog){
    hotDog=isIE ? hotDog.parentElement : hotDog.parentNode;
  }
  if (hotDog.id=="titleBar"){
    offsetx=isIE ? event.clientX : e.clientX;
    offsety=isIE ? event.clientY : e.clientY;
    nowX=parseInt(whichDog.style.left);
    nowY=parseInt(whichDog.style.top);
    ddEnabled=true;
    document.onmousemove=dd;
  }
}

function dd(e){
  if (!ddEnabled) return;
  whichDog.style.left=isIE ? nowX+event.clientX-offsetx : nowX+e.clientX-offsetx;
  whichDog.style.top=isIE ? nowY+event.clientY-offsety : nowY+e.clientY-offsety;
  return false;
}

function ddN4(whatDog){
  if (!isN4) return;
  N4=eval(whatDog);
  N4.captureEvents(Event.MOUSEDOWN|Event.MOUSEUP);
  N4.onmousedown=function(e){
    N4.captureEvents(Event.MOUSEMOVE);
    N4x=e.x;
    N4y=e.y;
  }
  N4.onmousemove=function(e){
    if (isHot){
      N4.moveBy(e.x-N4x,e.y-N4y);
      return false;
    }
  }
  N4.onmouseup=function(){
    N4.releaseEvents(Event.MOUSEMOVE);
  }
}

function hideMe(){
  if (isIE||isNN) whichDog.style.visibility="hidden";
  else if (isN4) document.theLayer.visibility="hide";
}

function showMe(){
  if (isIE||isNN) whichDog.style.visibility="visible";
  else if (isN4) document.theLayer.visibility="show";
}

//document.onmousedown=ddInit;
//document.onmouseup=Function("ddEnabled=false");



/*
Custom Windows-
Copyright Lars Bosboom
To add more shock to your site, visit www.DHTML Shock.com
*/

var closebutton = "/webimg/IMAGES/cross.gif"; //Adress of image of the button


var raampje, xtra, ytra;
//var pos1=0;
//var pos2=0;
function sleepen(e){
//window.status="in there";
if(window.event){ 
	b=event.button;
	e=window.event;
}
else b=e.which;
if (b!=1)return;	
//raampje = eval("maildiv");
temp1=document.getElementById('maildiv').style.left;
temp2=document.getElementById('maildiv').style.top;
xpos=e.clientX;
ypos=e.clientY;
xtra = parseInt(temp1.replace(/px/, ''))-xpos;
ytra = parseInt(temp2.replace(/px/, ''))-ypos;
//pos1 = e.clientX+xtra;
//pos2 = e.clientY+ytra;
//document.onmousemove=plaats;
}
function plaats(e){

if(window.event){
	e=window.event;
	b=e.button;
}else
	b=e.which;

if (b==1){
//raampje.style.pixelLeft=event.clientX+xtra;
//raampje.style.pixelTop=event.clientY+ytra;return false;}}
document.getElementById('maildiv').style.left=e.clientX + xtra;
document.getElementById('maildiv').style.top=e.clientY + ytra;}}

function raam(inside, color,width,height, background ,title, e){	
getMouseXY(e);
tempX = tempX + 10;
tempY = tempY + 10;
titlecolor = "black"; 						
opacitytitle = 75;   						
if(!width){
width = 500;            					
height = 325;}								
if(inside.indexOf(".htm") > inside.length -6)
inside = "<iframe frameborder=0 name=\"raampje\" width="+(width-10)+" height="+(height-30)+" src=\""+inside+"\" scrolling=\"no\" style='position : relative;'></iframe>";
if(!color)
color = "silver";							
thisspan = eval("document.getElementById('maildiv').style")

thisspan.left = tempX+"px";
thisspan.top = tempY+"px";

output = "<div style='border : 1px #AAA solid;'><table cellpadding='0' cellspacing='0' width='" + width + "' border='0' style='border : 1px #333 solid;'>";
output += "<tr style='border : #666 solid; border-width : 0 0 1px 0;'>";
output += "<td width='" + (width - 25) + "' height='21px' onMouseDown='sleepen(event); document.onmousemove=plaats' onmouseup='JavaScript:document.onmousemove=\"\"' style='padding-left : 5px; background : url(/webimg/IMAGES/Generic/GRAD_MouseoverBox.gif); color : #36558E; font-family : Arial; font-weight : bold; font-size : 11px;'>";
output += title;
output += "</td>";
output += "<td align='right' style='padding-right : 5px; background : url(../webimg/IMAGES/Generic/GRAD_MouseoverBox.gif);'>";
output += "<div style='cursor : hand; display : inline;' onclick='closeraam()'>";
output += "<img src='../webimg/IMAGES/buttons/BUT_Win_Close.gif' border='0'>";
output += "</div>";
output += "</td>";
output += "</tr>";
output += "<tr>";
output += "<td width='100%' colspan='2' style='border : #999 solid; border-width : 2px 0 0 0; padding : 5px; font-family : Arial; font-size : 11px; color : #333; background-color : #DEDEDE;'>";
output += inside;
output += "</td>";
output += "</tr>";
output += "</table></div>";

document.getElementById('maildiv').innerHTML = output;
thisspan.visibility="visible";
}
function closeraam() {
document.getElementById('maildiv').style.visibility="hidden";
return false;
}

function groet()
{
outp = "";
outp += "<center><h2>In this window you can place everything you want.</h2>";
outp +="You can type your complete HTML code in this and you can change the size,";
outp += " specify a background image or color when you don't have an image, change the color of the title bar.";
outp += "It's also possible to use an external HTML file. To use a HTML file you only";
outp += " have to specify it<br>";
outp += "<h5>For questions or suggestions mail the designer <a href='mailto:ejl@worldmailer.com'>Lars Bosboom</a>";
raam(outp, "lightblue",400,200);
}

function firstwindow(top, left,title,text, e)
{
outp = text;
//outp += text;
raam(outp, "lightblue",225,50,'',title, e);
}



function second()
{
outp = "";
outp += "<h2 align='center'>Yep, the number of windows are unlimited</h2>";
raam(outp, "lightyellow",470,50);
}


// Detect if the browser is IE or not.
// If it is not IE, we assume that the browser is NS.
//var IE = document.all?true:false

// If NS -- that is, !IE -- then set up for mouse capture
//if (!IE) document.captureEvents(Event.MOUSEMOVE)

// Set-up to use getMouseXY function onMouseMove
document.onmousemove = getMouseXY;

// Temporary variables to hold mouse x-y pos.s
var tempX = 0
var tempY = 0

// Main function to retrieve mouse x-y pos.s

function getMouseXY(e) 
{
	if (window.event) e = window.event;
	if (e.pageX | e.pageY)
	{
		tempX = e.pageX;
		tempY = e.pageY;
	}
	else if (e.clientX | e.clientY)
	{
		tempX = e.clientX + document.body.scrollLeft;
		tempY = e.clientY + document.body.scrollTop;
	}
	//window.status = tempX + " " + tempY;
	//document.getElementById("test").value=tempX + " " + tempY;
	return;
}

function HandleSub(subd) {
marker = subd.lastIndexOf(':');
regionmarker = marker+1;
regid=subd.substring(regionmarker,7);
subd=subd.substring(0,marker);

if (subd != "") {
document.LANSA.AJ11SID.value=subd;
document.LANSA.AJ10RID.value=regid;
HandleEvent('JC10WEB','JC11V82');
} else {
alert('Please choose a valid community');
}
}

//This is the HRS image click from inside the community
// do not need to have the region and subdivision
function HRelModel(prod,series,model) {
document.LANSA.AE01TID.value=prod;
document.LANSA.SE01SNO.value=series;
document.LANSA.AJ62MDL.value=model;
HandleEvent('JC10WEB','JC62V84');
}

//This is the HRS image click from the "0" Money Down Ad
// needed to have the region and subdivision
function HRelModelAd(reg,subd,prod,series,model) {
document.LANSA.AJ10RID.value=reg;
document.LANSA.AJ11SID.value=subd;
document.LANSA.AE01TID.value=prod;
document.LANSA.SE01SNO.value=series;
document.LANSA.AJ62MDL.value=model;
HandleEvent('JC10WEB','JC62V84');
}

//This is the HRS image click from the models drop down
// needed to have the region and subdivision
function HRelModelMod(reg,subd,prod,series,model) {
document.LANSA.AJ10RID.value=reg;
document.LANSA.AJ11SID.value=subd;
document.LANSA.AE01TID.value=prod;
document.LANSA.SE01SNO.value=series;
document.LANSA.AJ62MDL.value=model;
HandleEvent('JC10WEB','JC62V84');
}

function HandleJob(comp,regn,subd,jobno) {
document.LANSA.SY30CNO.value=comp;
document.LANSA.AJ10RID.value=regn;
document.LANSA.AJ11SID.value=subd;
document.LANSA.AJ13JOB.value=jobno;
HandleEvent('REPORTS','PSA');
}

function ChangeLayerText(title,city,top,left, e) {
if(window.event) e=window.event;
//titletext.innerHTML=title;
document.getElementById('layertxt').innerHTML=document.LANSA[city].value;
outtxt = document.LANSA[city].value;
firstwindow(top,left,title,outtxt, e);
}

// This is the "0" Money Down Ad
function HandlePitAd( ) {
HandleEvent('JC10WEB','JC11V87');
}

function HandleCity(company, city) {
document.LANSA.SY30CNO.value=company;

setAN11CIT(city);

HandleEvent('JC10WEB','JC11V81');
}

function HandleState(company) {
document.LANSA.SY30CNO.value=company;
HandleEvent('JC10WEB','SY30V81');
}

function HandleModState(company) {
document.LANSA.AJ11STE.value=company;
HandleEvent('JC10WEB','SY30V89');
}

function HandleModel(model) {
document.LANSA.AMODNAME.value=model;
HandleEvent('JC10WEB','JC62V85');
}
function HandleCities(cities) {
document.LANSA.SY30CNO.value=cites;
HandleEvent('JC10WEB','SY30V82');
}
function HandleSeries(series) {
document.LANSA.SY30CNO.value=series;
HandleEvent('JC10WEB','ES01V81');
}
function HandleModSer(modser) {
document.LANSA.SE01SNO.value=modser;
HandleEvent('JC10WEB','ES01V82');
}
function HandleModl(subd,modl) {
document.LANSA.AJ11SID.value=subd;
document.LANSA.AJ62MDL.value=modl;
HandleEvent('JC10WEB','JC62V84');
}
function HandleGmodl(gmodl) {
document.LANSA.AJ62MDL.value=gmodl;
HandleEvent('JC10WEB','JC62V87');
}
function HandleTour(tour) {
document.LANSA.SY30CNO.value=tour;
HandleEvent('JC10WEB','JC11V86');
}
function HandleStCity(stabb) {
document.LANSA.AJ11STE.value=stabb;
HandleEvent('JC10WEB','SY30V84');
}

function HandleTourCity(tourcit) {
document.LANSA.AJ11STE.value=tourcit;
HandleEvent('JC10WEB','SY30V87');
}

function HandleSerreq(company, city) {
document.LANSA.SY30CNO.value=company;
document.LANSA.AN11CIT.value=city;
HandleEvent('JC10WEB','JC13J02');
}

function HandleFCity(stcity) {
document.LANSA.SY30CNO.value=stcity;
HandleEvent('JC10WEB','SY30V86');
}

function HandleOCity(stcity) {
document.LANSA.AJ11STE.value=stcity;
HandleEvent('JC10WEB','SY30V88');
}

function HandleJobOpp(jcomp, jcity) {
document.LANSA.SY30CNO.value=jcomp;
document.LANSA.AN11CIT.value=jcity;
HandleEvent('JC10WEB','JC10V81');
}
function HandleJobHose(jobnum) {
document.LANSA.ACURJOB.VALUE = jobnum;
HandleEvent('JC13WEB','JC13V80');
}

function HandleOhoSer(comp) {
document.LANSA.SY30CNO.VALUE = comp;
HandleEvent('JC10WEB','JC13J02');
}

function HandleCustcare(comp) {
document.LANSA.SY30CNO.value = comp;
HandleEvent('JC10WEB','JC10V94');
}


function DidYouKnow( ) {
window.open("/webimg/didyouknow.htm","DidYouKnow","width=510,height=670,top=0,status=yes,resizable=yes");
}
function NewsJournal( ) {
window.open("/webimg/newsjournal.pdf","NewsJournal","width=414,height=765,top=0,status=yes,scrollbars=yes,resizable=yes");
}
function SouthLakePress( ) {
window.open("/webimg/southlakepress.pdf","SouthLakePress","width=414,height=765,top=0,status=yes,scrollbars=yes,resizable=yes");
}
function OviedoVoice( ) {
window.open("/webimg/oviedovoice.pdf","OviedoVoice","width=414,height=765,top=0,status=yes,scrollbars=yes,resizable=yes");
}
function StarBanner( ) {
window.open("/webimg/starbanner.pdf","StarBanner","width=414,height=765,top=0,status=yes,scrollbars=yes,resizable=yes");
}
function LatinoInternacional( ) {                                               
window.open("/webimg/latino.pdf","LatinoInternacional","width=414,height=765,top=0,status=yes,scrollbars=yes,resizable=yes"); 
}

function OsceolaNews( ) {
window.open("/webimg/osceolanews.pdf","OsceolaNews","width=414,height=765,top=0,status=yes,scrollbars=yes,resizable=yes");
}

//function Ad( ) {
//window.open("/webimg/ad.htm","Ad","width=814,height=597,top=0,status=yes,scrollbars=yes,resizable=yes");
//}

// This is the popup used for posting Holiday hours
//function HolidayHours( ) {
//window.open("/webimg/Holiday.htm","Holiday","width=575,height=400,top=0,status=yes,scrollbars=yes,resizable=yes");
//}


function HandleComSub(comp, city, regd, subd) {
document.LANSA.SY30CNO.value = comp;
document.LANSA.AN11CIT.value = city;
document.LANSA.AJ10RID.value=regd;
document.LANSA.AJ11SID.value=subd;
HandleEvent('JC10WEB','JC11V82');
}

function HandleEvent(Proc,Func) { 
	//if (document.LANSA._PROCESS.value != "&NULL") {
	//	if (document.LANSA._FUNCTION.value != "&NULL") {
	if(Proc != "" || Func != ""){
			document.LANSA._PROCESS.value=Proc;
			document.LANSA._FUNCTION.value=Func;
			document.LANSA.submit();
	}
	//	}
	//}
}

function HandlePaContactUs(company, city) {    
document.LANSA.SY30CNO.value=company;          
document.LANSA.AN11CIT.value=city;             
HandleEvent('JC10WEB2','JC13S82');             
}

function HandleCityTRC(company, city, clickOrig) {
document.LANSA.ATRC_ORIG.value=clickOrig;
HandleCity(company, city);
//document.LANSA.AN11CIT.value=city;
//document.LANSA.SY30CNO.value=company;
//HandleEvent('JC10WEB','JC11V81');
}

function HandlePitAdTRC(company, city, clickOrig) {
document.LANSA.SY30CNO.value=company;          
document.LANSA.AN11CIT.value=city;   
document.LANSA.ATRC_ORIG.value=clickOrig;
HandlePitAd();
//HandleEvent('JC10WEB','JC11V87');
}

function HandlePitAdsTRC(company, city, clickOrig) {
document.LANSA.SY30CNO.value=company;          
document.LANSA.AN11CIT.value=city;   
document.LANSA.ATRC_ORIG.value=clickOrig;
HandleEvent('JC13WEB','JC13J78');
}

function HandleStCityTRC(stabb, clickOrig) {
document.LANSA.ATRC_ORIG.value=clickOrig;
HandleStCity(stabb);
//document.LANSA.SY30CNO.value=stcity;
//HandleEvent('JC10WEB','SY30V84');
}

function HandleFCityTRC(stcity, clickOrig) {
document.LANSA.ATRC_ORIG.value=clickOrig;
HandleFCity(stcity);
}

function HandleOCityTRC(stcity, clickOrig) {
document.LANSA.ATRC_ORIG.value=clickOrig;
HandleOCity(stcity);
}

function HandleStateTRC(company, clickOrig) {
document.LANSA.ATRC_ORIG.value=clickOrig;
HandleState(company);
//document.LANSA.SY30CNO.value=company;
//HandleEvent('JC10WEB','SY30V81');
}

function HandleModStateTRC(company, clickOrig) {
document.LANSA.ATRC_ORIG.value=clickOrig;
HandleModState(company);
//document.LANSA.SY30CNO.value=company;
//HandleEvent('JC10WEB','SY30V81');
}

function HandleTourTRC(tour, clickOrig) {
document.LANSA.ATRC_ORIG.value=clickOrig;
HandleTour(tour);
//document.LANSA.SY30CNO.value=tour;
//HandleEvent('JC10WEB','JC11V86');
} 

function HandleTourCityTRC(tourcit, clickOrig) {
document.LANSA.ATRC_ORIG.value=clickOrig;
HandleTourCity(tourcit);
//document.LANSA.SY30CNO.value=tour;
//HandleEvent('JC10WEB','SY30V87');
} 

function HandleSerreqTRC(company, city, clickOrig) {
document.LANSA.ATRC_ORIG.value=clickOrig;
HandleSerreq(company, city);
//document.LANSA.SY30CNO.value=tour;
//HandleEvent('JC10WEB','SY30V87');
} 

function HandleSubTRC(subd, clickOrig) {
	document.LANSA.ATRC_ORIG.value=clickOrig;
	marker = subd.split(":")

	subd = marker[0];
	regid = marker[1];
	cno = marker[2];

	if (subd != "") {
		document.LANSA.AJ11SID.value=subd;
		document.LANSA.AJ10RID.value=regid;
		document.LANSA.SY30CNO.value=cno;
		HandleEvent('JC10WEB','JC11V82');
	} else {
		alert('Please choose a valid community');
	}
}

function HandleOWEvent(proc, func, winType) {
 savetarget = document.LANSA.target;
if (winType == 'L') {
 winind = window.open('',"winind","toolbar=yes,location=yes,directories=no, status=yes,menubar=yes,scrollbars=yes,resizable=no,copyhistory=yes,width=575,height=450");
}
if (winType == 'M') {
 winind = window.open('',"winind","width=1, height=1,left=1000, top=1000");
}
 document.LANSA.target = 'winind';
 HandleEvent(proc,func);
if (window.focus) {winind.focus()};
document.LANSA.target = savetarget;

}

function HandleEventMap(Proc,Func)
{
   if (document.LANSA._PROCESS.value != "&NULL")
   {
   if (document.LANSA._FUNCTION.value != "&NULL")
   {
   document.LANSA.ATRC_ORIG.value='MAP';
   document.LANSA._PROCESS.value=Proc;
   document.LANSA._FUNCTION.value=Func;
   document.LANSA.submit();
   }
   }
}

/* This function adds http:// to links that do not have it */
function showLink(url){
url = url.toLowerCase();
var webLink = url;
var add = "http://";
if(webLink.substring(0,4) != "http"){
     webLink = add + webLink;
     window.location.href=webLink;
	}
else{
     window.location.href=url;
   }
}
