//Fix the Netscape / IE problem with ID tag addressing
function DOMGetElement(o)
{
  if (document.getElementById)
	return document.getElementById(o);
  else if (document.all)
	return document.all[o];
  else if (document.layers)
	return document.layers[o];
	
  return null;
}

//Window Opener
function openWindow(url, width, height)
{
	var options = "channelmode=0,directories=0,fullscreen=0,height=" + height + ",left=100,location=0,menubar=0,resizable=1,scrollbars=1,status=0,titlebar=0,toolbar=0,top=100,width=" + width + "'";
	window.open(url,'',options,true);	
}

var tstr,srcElem,toElem;
function Left(elem) {
	var x=-1;
	while(elem) {
		x+=elem.offsetLeft;
		elem=elem.offsetParent;
	} return x;
}

function changeclass(element,className) {
	element.setAttribute('className',className);
	element.setAttribute('class',className);
}

function Top(elem) {
	var x=-1;
	while(elem) {		
		x+=elem.offsetTop;
			elem=elem.offsetParent;
 	} return x;
}


function hideObjects()
{
     var selCount = document.all.tags("select");
     for (i=0; i<selCount.length; i++)
          selCount[i].style.visibility = "hidden";
}

function showObjects() {
 selCount=document.all.tags("select")
     for (i=0;i<selCount.length;i++)
          selCount[i].style.visibility="visible"
}

function doMouseOver1(element) {
	changeclass( element, 'mouseOver' );
}

function doMouseOut1(element) {
	changeclass( element, 'mouseOut' );
}


function hide(e,id) {			
	srcElem=e.target?e.target:e.srcElement;//e?e.target:event.srcElement;
	toElem=e.relatedTarget?e.relatedTarget:e.toElement;//e?e.currentTarget:event.toElement;
	tstr=srcElem.id.replace('tx_','');

	if((tstr==id.replace('tx_','').substring(0,tstr.length)) ||(toElem.id.substring(0,4)!='menu'))
	
		if (document.getElementById(id)) {
			document.getElementById(id).style.visibility='hidden';	
			showObjects();			
		}
}

function show(id) {
	if (document.getElementById(id)) {
		document.getElementById(id).style.visibility='visible';
	}
}	

function showXY(callingItem,id,isRoot) {
	if (document.getElementById(id)&&(document.getElementById(id).style.visibility!='visible')) {
		if (!isRoot) {
			document.getElementById(id).style.top=(callingItem.substr(callingItem.lastIndexOf('_')+1,callingItem.length)-1)*document.getElementById(callingItem).offsetHeight + 2;
			document.getElementById(id).style.left=document.getElementById(callingItem).offsetWidth - 7;
		}
		else {
			document.getElementById(id).style.top=Top(document.getElementById(callingItem))+document.getElementById(callingItem).offsetHeight-2;
			document.getElementById(id).style.left=Left(document.getElementById(callingItem));
		}
			
		document.getElementById(id).style.visibility='visible'; 
	}
}



// <!-- 1339559629
// This script is (C) Copyright 2004 Jim Tucek
// Leave these comments alone!  For more info, visit
// www.jracademy.com/~jtucek/email/ 
// 29 ... 59

function burn(attitude,alternative,squirrel) {
	attitude += ' ';
	var sand = attitude.length;
	var kiss = 0;
	var cavern = '';
	for(var companion = 0; companion < sand; companion++) {
		kiss = 0;
		while(attitude.charCodeAt(companion) != 32) {
			kiss = kiss * 10;
			kiss = kiss + attitude.charCodeAt(companion)-48;
			companion++;
			}
		cavern += String.fromCharCode(overdo(kiss,alternative,squirrel));
		}
	parent.location = 'm'+'a'+'i'+'l'+'t'+'o'+':'+cavern;
	}

function choose(composer,conception,thing) {
	composer += ' ';
	var speech = composer.length;
	var equipment = 0;
	for(var lip = 0; lip < speech; lip++) {
	equipment = 0;
	while(composer.charCodeAt(lip) != 32) {
		equipment = equipment * 10;
		equipment = equipment + composer.charCodeAt(lip)-48;
		lip++;
	}
	//document.write('&');
	//document.write('#');
	//document.write(overdo(equipment,conception,thing));
	document.write(String.fromCharCode(overdo(equipment,conception,thing)));
	}
}

function overdo(pencil,law,place) {
	if (place % 2 == 0) {
		doctor = 1;
		for(var name = 1; name <= place/2; name++) {
		minute = (pencil*pencil) % law;
		doctor = (minute*doctor) % law;
		}
		} else {
		doctor = pencil;
		for(var obstetrics = 1; obstetrics <= place/2; obstetrics++) {
		minute = (pencil*pencil) % law;
		doctor = (minute*doctor) % law;
		}
	}
	return doctor;
}



//BREAK OUT OF FRAME
function framebreakout()
{
  //if (top.location != location) {
  //  top.location.href = document.location.href ;
  //}
}

function BrowseFranchise()
{
	top.location.href = '/Franchise';
}

function BrowseServices()
{
	top.location.href = '/Services';
}