//used on the photo gallery page
function switchgalleryphoto(newphoto){
	document.getElementById('mainphoto').setAttribute("src",newphoto);
}
/************************************************************************/
jQuery.noConflict();
(function($) { 
  	$(function() {
		// dropdown menu

		$("ul.sf-menu").supersubs({ 
			animation     : {opacity:"show",height:"show"}
	        ,delay        : 80
        	,speed        : "normal"
    	    ,dropShadows  : false  // keep false (caused rendering  issues in older IE's)
	        ,oldJquery    : false  // set to true if using jQuery version below 1.2
        	,disableHI    : true   // set to true to disable hoverIntent detection
    	    ,autoArrows   : false  // disable generation of arrow mark-up 
			,minWidth:    12,   
			maxWidth:    27,    
			extraWidth:  1 
		}).superfish();	

		// slideshow
    	$('#testimonials')
			.cycle({
				fx: 'fade',
				speed: 1, 
				timeout: 4000
		});

		$('button, input:submit, .abutton').button();
	
		$("a[rel='colorbox']").colorbox({
			transition:"fade",
	//		current: "{current} of {total}"
			current: ""
		});	
	
		// round corners
		$(".roundedcorner").corner();


	});



/********************************************************/
//jquery dropdown menu
var timeout    = 500;
var closetimer = 0;
var ddmenuitem = 0;

function mainmenu_open()
{  mainmenu_canceltimer();
   mainmenu_close();
   ddmenuitem = $(this).find('ul').css('visibility', 'visible');}

function mainmenu_close()
{  if(ddmenuitem) ddmenuitem.css('visibility', 'hidden');}

function mainmenu_timer()
{  closetimer = window.setTimeout(mainmenu_close, timeout);}

function mainmenu_canceltimer()
{  if(closetimer)
   {  window.clearTimeout(closetimer);
      closetimer = null;}}

$(document).ready(function()
{  $('#jmainmenu > li').bind('mouseover', mainmenu_open)
   $('#jmainmenu > li').bind('mouseout',  mainmenu_timer)});

document.onclick = mainmenu_close;


})(jQuery);

//***********************************************************************************
function submitsearch(){ 
	document.searchform.submit();}
//***********************************************************************************
function loadpage(thepagename){
}
//***********************************************************************************
function getElementHeight(Elem) {
	if (ns4) {
		var elem = getObjNN4(document, Elem);
		return elem.clip.height;
	} else {
		if(document.getElementById) {
			var elem = document.getElementById(Elem);
		} else if (document.all){
			var elem = document.all[Elem];
		}
		if (op5) { 
			xPos = elem.style.pixelHeight;
		} else {
			xPos = elem.offsetHeight;
		}
		return xPos;
	} 
}
//*****************************************************************************************
String.prototype.trim = function() {
	return this.ltrim().rtrim();
};

String.prototype.ltrim = function() {
	return this.replace(/^\s+/,"");
}

String.prototype.rtrim = function() {
	return this.replace(/\s+$/,"");
}
//***********************************************************************************
