function rotateMarq(){
	var m = document.getElementById("Marq");	
	var l = document.getElementById("Logos");
	var fc = l.getElementsByTagName("img");
	var c = l.getElementsByTagName("a")[0];
	l.style.left ="0px";
	new Silk(l, "left", null, (fc[0].clientWidth*-1), "px", 1, function (){ l.removeChild(c); l.appendChild(c); rotateMarq();}); 
}
function toggleMenu(ele){
	var cont = document.getElementById("topMenu");
	var r = document.getElementById("Rentals");
	var h = document.getElementById("Holidays");
	var s = document.getElementById("ForSale");
	var a = document.getElementById("AvailabilitySearch");
	var el = document.getElementById(ele);

		if(r.style.top=="0px" || h.style.top=="0px" || s.style.top=="0px" || a.style.top=="0px"){
			new Silk(cont, "height", null, 23, "px", 25, null);
			new Silk(r, "top", null, -260, "px", 25, function(){r.style.zIndex="52"});
			new Silk(h, "top", null, -260, "px", 25, function(){h.style.zIndex="51"});
			new Silk(s, "top", null, -190, "px", 25, function(){s.style.zIndex="53"});
			new Silk(a, "top", null, -190, "px", 25, function(){a.style.zIndex="50"});
			if(el.style.top=="0px"){
				return;
			}
			setTimeout(function(){toggleMenu(ele)},2);
		}
	if(el==a){
		var height = 213;
	}
	else{
		var height = 283;
	}
	new Silk(cont, "height", null, height, "px", 25, null);
	new Silk(el, "top", null, 0, "px", 25, null);
	el.style.zIndex="49";
	return;	
}

function resetCss(){
	if(navigator.userAgent.indexOf("Firefox")!=-1){
		var versionindex=navigator.userAgent.indexOf("Firefox")+8
		if (parseInt(navigator.userAgent.charAt(versionindex))>=1)
		var oldCss = document.getElementById('maincss').href;
		document.getElementById('maincss').href='';
		document.getElementById('maincss').href=oldCss;
		var oldCss2 = document.getElementById('templatecss').href;
		document.getElementById('templatecss').href='';
		document.getElementById('templatecss').href=oldCss2;
	}
}
function NewWin(Location, Width, Height) {
	var leftprop, topprop, screenX, screenY;
	if(navigator.appName == "Microsoft Internet Explorer") {
		screenY = document.body.offsetHeight;
		screenX = window.screen.availWidth;
	} else {
		screenY = window.outerHeight
		screenX = window.outerWidth
	}

	leftvar = (screenX - Width) / 2;
	rightvar = (screenY - Height) / 2;
	if(navigator.appName == "Microsoft Internet Explorer") {
		leftprop = leftvar;
		topprop = rightvar;
	} else {
		leftprop = (leftvar - pageXOffset);
		topprop = (rightvar - pageYOffset);
	}
	
	Name = 'NewWin'
	VP=window.open(Location, Name,'menubar=no,titlebar=no,toolbar=no,scrollbars=yes,status=no,width=' + Width + ',height=' + Height + ',left=' + leftprop + ',top=' + topprop + ',resizable=yes');
	VP.focus();
}
function MapWin(Location, Width, Height) {
	var leftprop, topprop, screenX, screenY;
	if(navigator.appName == "Microsoft Internet Explorer") {
		screenY = document.body.offsetHeight;
		screenX = window.screen.availWidth;
	} else {
		screenY = window.outerHeight
		screenX = window.outerWidth
	}

	leftvar = (screenX - Width) / 2;
	rightvar = (screenY - Height) / 2;
	if(navigator.appName == "Microsoft Internet Explorer") {
		leftprop = leftvar;
		topprop = rightvar;
	} else {
		leftprop = (leftvar - pageXOffset);
		topprop = (rightvar - pageYOffset);
	}
	
	Name = 'MapWin'
	VP=window.open(Location, Name,'menubar=no,titlebar=no,toolbar=no,scrollbars=yes,status=no,width=' + Width + ',height=' + Height + ',left=' + leftprop + ',top=' + topprop + ',resizable=yes');
	VP.focus();
}

function Go(link) {
	location.href = link;
}
function scrollWindow(xScroll, yScroll){
	scroll((getScrollXY()[0] + (0-xScroll*8*3)),(getScrollXY()[1] +  (0-yScroll*8*3)));
	return true;
}
function getScrollXY() {
	var scrOfX = 0, scrOfY = 0;
	if( typeof( window.pageYOffset ) == 'number' ) {
		//Netscape compliant
		scrOfY = window.pageYOffset;
		scrOfX = window.pageXOffset;
	} else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
		//DOM compliant
		scrOfY = document.body.scrollTop;
		scrOfX = document.body.scrollLeft;
	} else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
		//IE6 standards compliant mode
		scrOfY = document.documentElement.scrollTop;
		scrOfX = document.documentElement.scrollLeft;
	}
	return [ scrOfX, scrOfY ];
}

