﻿/* EasyNewsPlus jQuery plugin
$(document).ready(function(){
	var newsoption = {
		firstname: "newsticker-wrapper",
		secondname: "showhere",
		thirdname:"news_display",
		fourthname:"news_button" ,
		playingtitle:"Now Playing:",
		nexttitle:"Next News:",
		prevtitle:"prev News:",
		newsspeed:'8000',
		isauto:'1'
	}
	$.init_plus(newsoption);
}); */

/* jQuery vertical news ticker */
$(function() {
	$(".newsticker").jCarouselLite({
		vertical: true,
		hoverPause:true,
		visible: 2,
		auto:500,
		speed:10000
	});
});

/* jQuery property gallery image zoom */
$(function(){
	var URL = window.location.href;
    var dir = unescape(URL.substring(0,(URL.lastIndexOf("/")) + 1));
	var rslt = dir.search(/listings/);
	if (rslt > 0) {
		$('#gallery a').fancyzoom({Speed:400,showoverlay:true,overlay:4/10});
		$('img.fancyzoom').fancyzoom();
	}
});


/*
	Frank Marion, http://www.frankmarion.com

	Date Created:	Wednesday, July 14, 2004 05:37 PM
	Last Modified:	Monday, November 1, 2004 06:05 PM
	Revision:		1.0

	Function: Display the image retrieved from the caller's TD
	in it's own window at full size.

	Usage:	<td onclick="propImgView(this);">
image_popup.html
*/
// Popup window at 200h x 400w to display a flash movie
function popVid(url) {
	if (url != null) {
		win_props = 'toolbar=no,location=no,directories=no,status=no,' 
		+ 'menubar=no,scrollbars=no,resizable=yes,width=400,height=300,top=25,left=25';
		window.open(url,'remote',win_props);
	}
}



/*

	Frank Marion, http://www.frankmarion.com

	Date Created:	Wednesday, July 14, 2004 05:37 PM
	Last Modified:	Monday, November 1, 2004 06:05 PM
	Revision:		1.0

	Function: Display the image retrieved from the caller's TD
	in it's own window at full size.

	Usage:	<td onclick="propImgView(this);">
image_popup.html
*/
// Calling page (gallery grid view)
function propImgView(obj) {
	image = obj.childNodes.item(0).src;
	domain = 'http://'+location.hostname+'/';
	if (obj.childNodes.item(0).src != null) {
		win_props = 'toolbar=no,location=no,directories=no,status=no,' 
		+ 'menubar=no,scrollbars=no,resizable=yes,width=640,height=480,top=25,left=25';
		remote = window.open(domain + 'js/pop_img.html','remote',win_props);
	}
}

// General image popup
// Usage:  <img src="#" onclick="imgPop(this);">
function imgPop(obj) {
	image = obj.src
	domain = 'http://' + location.host +'/';
	if (obj.src != null) {
		win_props = 'toolbar=no,location=no,directories=no,status=no,' 
		+ 'menubar=no,scrollbars=no,resizable=yes,width=640,height=480,top=25,left=25';
		remote = window.open(domain + 'js/pop_img.html','remote',win_props);
		alert(remote);
	}
}



/*
	A simple email obfuscator. Usage is simple:
	
	<script>
		document.write(obfuscate('com','example','test','how'));
	</script>
	
	com 	= 	the domain extension. Can be any valid top level domain (test@example.COM)
	example = 	the actual domain. (test@EXAMPLE.com)
	test	= 	the email user name (TEST@example.com)
	how		= 	'm' builds the whole mailto:link; default uses href.location for onclick (non-link usage)
	text	= 	text to be displayed in the link if not the email. !!! Is NOT OBFUSCATED !!! If blank, shows email

	This won't stop email harvesters that can interpret javascript, but most are cheap pieces of junk
	written by second rate Windows programmers trying to make a buck. 
	
	I can be reached at obfuscate('com','frankmarion','business','m','Send mail!');  :)
	
*/

function obfuscate(ext,dom,adr,how,text,subj) {
	var i;
	var obfEmail;
	var email = adr+'\@'+dom+'\.'+ext;
	var how;
	var text;
	obfEmail = '';

	
	for (i=0; i<email.length; i++) {
		var code = email.charCodeAt(i);
		if (chars[code]) {
			obfEmail = obfEmail + '&#';
			if (code < 100) {obfEmail = obfEmail + '0';}
				obfEmail = obfEmail + code + ';';
			} else {
				obfEmail.value = obfEmail + email.charAt(i);
			}
		}
	
		if (how == 'm') {
			if (text !='' && text != null) {
				return '<a href="mailto:'+obfEmail+'">'+text+'</a>';
			} else {
				return '<a href="mailto:'+obfEmail+'">'+obfEmail+'</a>';
			}
		} else {
			document.location.href='mailto:'+email; return false;
		}
	}

		var chars = new Array (255);
		var i;
		for (i=0; i<chars.length; i++) {
		  chars[i] = false;
		}
		for (i=32; i<127; i++) {
		  chars[i] = true;
	}

// End