// JQUERY to manage menu dropdown/accordion etc behaviour.
// perform rollover for logo ... this could and should be generalized or else put inline


/*function onAfter() { 
	var newsource = $(this).attr('src');
	newsource = newsource.replace(_med)
    $('#larger').attr("href", $(this).attr('src')); 
}*/

<!-- Script by hscripts.com -->


function img_popup(img) {
 var Popup = window.open("", "_blank",  "toolbar=0,resize=1,status=0,menubar=0,scrollbars=1,width=800,height=800");
 Popup.document.open();
 Popup.document.write("<html><head><title>SPI Design</title></head><body>");
 Popup.document.write('<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0"><tr><td align="center" valign="middle" width="800" height="750">');
 Popup.document.write("<img src='" + img + "'>");
 Popup.document.write("</td></td></table>");
 Popup.document.write("</body></html>");
 Popup.document.close();
}

<!-- Script by hscripts.com -->


$(document).ready( function() {
		// hide canyon ranch entry temporarily
		//$("ul#menu >li:eq(1)> ul >li:eq(2)").hide();
		// perform logo rollover (would be better if this were a class for all rollovers
		$("#logo img").hover( 
				function() { 
						var source = $(this).attr("src");
						source = source.replace("logo.gif", "logo2.gif");
						$(this).attr("src", source);
						},
				function() {
						 var source = $(this).attr("src");
						source = source.replace("logo2.gif", "logo.gif");
						$(this).attr("src", source);
				});
	
		// different sized popups
			$('.modalopen').click(function(){ 
					img_popup(this.href);
					return false;
				});
		$('a.popup').click(function(){ 
					window.open(this.href, 
						'_blank',
						'scrollbars=yes,resizable=yes,width=600,height=400');
					return false;
				});
		$('a.popupSmall').click(function(){ 
					window.open(this.href, 
								'_blank',
								'scrollbars=yes,resizable=yes,width=400,height=280');
					return false;
				});
		$('a.popupVideo').click(function(){ 
					window.open(this.href, 
								'_blank',
								'scrollbars=yes,resizable=yes,width=650,height=500');
					return false;
				});
//  modal box open and close
// #modalbox is containing div, content goes into #modalcontent
// closing link is .modalclose , open is .modalopen


/*$('.modalopen').click(function(){
		var imglink = $(this).attr('href');					  
		$('#modalbox #modalcontent').html('<img src="'+imglink+'"   border="0" />');
		$('#modalbox').fadeIn();
		return false;
 });

 $('.modalclose').click(function(){
		$('#modalbox').fadeOut();
 });*/
 
 
	
	})	
		

