/*--------------------------------------------------------------------------------------------------------------------------------
	SafeMail
--------------------------------------------------------------------------------------------------------------------------------*/
function safemail(name, domain, display, subject, style) {
displayed=(typeof(display)=="undefined") ? name+"@"+domain : display
subjected=(typeof(subject)=="undefined") ? '' : '?subject='+subject
styled=(typeof(style)=="undefinded") ? '' : 'class='+style+' '
document.write('<a ' + styled + 'href=mailto:' + name + '@' + domain + subjected + '>' + displayed + '</a>');
}

/*-------------------------------------------------------------------------------------------------------------------------------- 
	Menu Functions 
--------------------------------------------------------------------------------------------------------------------------------*/
function LmOver(elem, clr) {
	elem.style.backgroundColor = clr;
	elem.children.tags('A')[0].style.color = "#DDDDDD";
	elem.style.cursor = 'hand';
}

function LmOut(elem, clr) {
	elem.style.backgroundColor = clr;
	elem.children.tags('A')[0].style.color = "#FFFFFF";
}

function LmDown(elem, clr) {
	elem.style.backgroundColor = clr;
	elem.children.tags('A')[0].style.color = "#DDDDDD";
}

function LmUp(path) {
	location.href = path;
}

/*--------------------------------------------------------------------------------------------------------------------------------
	Open Window Function
--------------------------------------------------------------------------------------------------------------------------------*/	
/* Portrait Window 645 x 480 */
function launchport(target1){
	bth=window.open(target1,"Gallery","width=645,height=480,top=0,left=0,resizable=no,scrollbars=no,menubar=no,toolbar=no,status=no,location=no")
}
/* Landscape Window 425 x 705 */
function launchland(target1){
	bth=window.open(target1,"Gallery","width=425,height=705,top=0,left=0,resizable=no,scrollbars=no,menubar=no,toolbar=no,status=no,location=no")
}
/* Standard Window */
function launch(target1){
bth=window.open(target1,"Slideshow","width=640,height=480,top=0,left=0,resizable=no,scrollbars=no,menubar=no,toolbar=no,status=no,location=no")
}
/* Slideshow Window */
function slideshow(target1){
bth=window.open(target1,"Slideshow","width=610,height=457,top=0,left=0,resizable=no,scrollbars=no,menubar=no,toolbar=no,status=no,location=no")
}
/*--------------------------------------------------------------------------------------------------------------------------------
	Date Function
--------------------------------------------------------------------------------------------------------------------------------*/
function MakeArray(n) {
	this.length = n
	return this
}
monthNames = new MakeArray(12)
monthNames[1] = "January"
monthNames[2] = "February"
monthNames[3] = "March"
monthNames[4] = "April"
monthNames[5] = "May"
monthNames[6] = "June"
monthNames[7] = "July"
monthNames[8] = "August"
monthNames[9] = "September"
monthNames[10] = "October"
monthNames[11] = "November"
monthNames[12] = "December"
dayNames = new MakeArray(7)
dayNames[1] = "Sunday"
dayNames[2] = "Monday"
dayNames[3] = "Tuesday"
dayNames[4] = "Wednesday"
dayNames[5] = "Thursday"
dayNames[6] = "Friday"
dayNames[7] = "Saturday"

function customDateString() {
	currentDate = new Date()
	var theDay = dayNames[currentDate.getDay() + 1]
	var theMonth = monthNames[currentDate.getMonth() + 1]
	msie4 = ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4 ));
	if (msie4) {
	    var theYear = currentDate.getYear()
	}
	else {
	     var theYear = currentDate.getYear() +1900
	}
	return theDay + ", " + theMonth + " " + currentDate.getDate() + ", " + theYear
}

function showFilled(Value) {
  return (Value > 9) ? "" + Value : "0" + Value;
}

function StartClock24() {
  TheTime = new Date;
  document.clock.showTime.value = showFilled(TheTime.getHours()) + ":" + showFilled(TheTime.getMinutes()) + ":" + showFilled(TheTime.getSeconds());
  setTimeout("StartClock24()",1000)
}

/*--------------------------------------------------------------------------------------------------------------------------------
Disable right click script II (on images)- By Dynamicdrive.com
For full source, Terms of service, and 100s DTHML scripts
Visit http://www.dynamicdrive.com
--------------------------------------------------------------------------------------------------------------------------------*/

var clickmessage="Photo's Are © protected!"

var message = "Photo's Are © protected!"; 
function rtclickcheck(keyp){ 
	if (navigator.appName == "Netscape" && keyp.which == 3){
	 	alert(message); return false; 
	} 
	if (navigator.appVersion.indexOf("MSIE") != -1 && event.button == 2) {
	 	alert(message); 	return false; 
	} 
} 
document.onmousedown = rtclickcheck;

function disableclick(e) {
if (document.all) {
if (event.button==2||event.button==3) {
if (event.srcElement.tagName=="IMG"){
alert(clickmessage);
return false;
}
}
}
else if (document.layers) {
if (e.which == 3) {
alert(clickmessage);
return false;
}
}
else if (document.getElementById){
if (e.which==3&&e.target.tagName=="IMG"){
alert(clickmessage)
return false
}
}
}

function associateimages(){
for(i=0;i<document.images.length;i++)
document.images[i].onmousedown=disableclick;
}

if (document.all)
document.onmousedown=disableclick
else if (document.getElementById)
document.onmouseup=disableclick
else if (document.layers)
associateimages()

/*--------------------------------------------------------------------------------------------------------------------------------
	Swap Button Images
--------------------------------------------------------------------------------------------------------------------------------*/
function FP_swapImg() {//v1.0
 var doc=document,args=arguments,elm,n; doc.$imgSwaps=new Array(); for(n=2; n<args.length;
 n+=2) { elm=FP_getObjectByID(args[n]); if(elm) { doc.$imgSwaps[doc.$imgSwaps.length]=elm;
 elm.$src=elm.src; elm.src=args[n+1]; } }
}

function FP_preloadImgs() {//v1.0
 var d=document,a=arguments; if(!d.FP_imgs) d.FP_imgs=new Array();
 for(var i=0; i<a.length; i++) { d.FP_imgs[i]=new Image; d.FP_imgs[i].src=a[i]; }
}

function FP_getObjectByID(id,o) {//v1.0
 var c,el,els,f,m,n; if(!o)o=document; if(o.getElementById) el=o.getElementById(id);
 else if(o.layers) c=o.layers; else if(o.all) el=o.all[id]; if(el) return el;
 if(o.id==id || o.name==id) return o; if(o.childNodes) c=o.childNodes; if(c)
 for(n=0; n<c.length; n++) { el=FP_getObjectByID(id,c[n]); if(el) return el; }
 f=o.forms; if(f) for(n=0; n<f.length; n++) { els=f[n].elements;
 for(m=0; m<els.length; m++){ el=FP_getObjectByID(id,els[n]); if(el) return el; } }
 return null;
}

