//popups
function OpenBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function DirectionsPopup(){
	OpenBrWindow('directions_print.html','','scrollbars=yes,resizable=yes,width=510,height=425')
}

function DisclaimerPopup(){
	OpenBrWindow('disclaimer_print.html','','scrollbars=yes,resizable=yes,width=510,height=425')
}

function FacilitiesPopUp(){
	OpenBrWindow('facilities_print.html','','scrollbars=yes,resizable=yes,width=510,height=300')
}

function PreopPopup(){
	OpenBrWindow('preop_print.html','','scrollbars=yes,resizable=yes,width=510,height=425')
}

function LinksPopup(){
	OpenBrWindow('links.html','','scrollbars=yes,resizable=yes,width=510,height=425')
}

function ContactUsPopup(){
	OpenBrWindow('contactus.html','','scrollbars=yes,resizable=yes,width=510,height=425')
}


function ProceduresPopup(procnum){
	        switch(procnum)
			{
			case 1:
  			OpenBrWindow('http://www.sls.org/i4a/pages/index.cfm?pageid=3296','','scrollbars=yes,resizable=yes,width=510,height=425')
  			break;
			case 2:
  			OpenBrWindow('proc_abdominal.html','','scrollbars=yes,resizable=yes,width=510,height=425')
  			break;
			case 3:
  			OpenBrWindow('proc_breastcare.html','','scrollbars=yes,resizable=yes,width=510,height=425')
  			break;
			case 4:
  			OpenBrWindow('proc_hernia.html','','scrollbars=yes,resizable=yes,width=510,height=425')
  			break;
			case 5:
  			OpenBrWindow('proc_colon.html','','scrollbars=yes,resizable=yes,width=510,height=425')
  			break;
			case 6:
  			OpenBrWindow('proc_endocrine.html','','scrollbars=yes,resizable=yes,width=510,height=425')
  			break;
			case 7:
  			OpenBrWindow('proc_oncologic.html','','scrollbars=yes,resizable=yes,width=510,height=425')
  			break;
			}	
}


function PostopPopup(procnum){
	        switch(procnum)
			{
			case 1:
  			OpenBrWindow('postop_general.html','','scrollbars=yes,resizable=yes,width=510,height=425')
  			break;
			case 2:
  			OpenBrWindow('postop_hemorrhoid.html','','scrollbars=yes,resizable=yes,width=510,height=425')
  			break;
			case 3:
  			OpenBrWindow('postop_hernia.html','','scrollbars=yes,resizable=yes,width=510,height=425')
  			break;
			case 4:
  			OpenBrWindow('postop_breastbiop.html','','scrollbars=yes,resizable=yes,width=510,height=425')
  			break;
			case 5:
  			OpenBrWindow('postop_cholecystectomy.html','','scrollbars=yes,resizable=yes,width=510,height=425')
  			break;
			case 6:
  			OpenBrWindow('postop_skinlesions.html','','scrollbars=yes,resizable=yes,width=510,height=425')
  			break;
			case 7:
  			OpenBrWindow('postop_veinstripping.html','','scrollbars=yes,resizable=yes,width=510,height=425')
  			break;
  			case 8:
  			OpenBrWindow('proc_colon.html','','scrollbars=yes,resizable=yes,width=510,height=425')
  			break;
  			case 9:
  			OpenBrWindow('postop_managehemfissure.html','','scrollbars=yes,resizable=yes,width=510,height=425')
  			break;
			default:
  			OpenBrWindow('postop_general.html','','scrollbars=yes,resizable=yes,width=510,height=425')
			}	
}

//Footer
function tag_footer(){
var copyright_date = new Date();                    
var copyright_year = copyright_date.getFullYear(); 
var crt = '&copy;';
var txtline = ' Coastal Surgical. All rights reserved.<br>coastalsurgical.com is for informational purposes and should <br>not be considered medical advice, diagnosis or treatment recommendations.';
var tagline = crt + copyright_year + txtline;
document.write(tagline);
}

//For random selections
function fisherYates ( myArray ) {
  var i = myArray.length;
  if ( i == 0 ) return false;
  while ( --i ) {
     var j = Math.floor( Math.random() * ( i + 1 ) );
     var tempi = myArray[i];
     var tempj = myArray[j];
     myArray[i] = tempj;
     myArray[j] = tempi;
   }
}

function randowmImages (){
var sufflepics = new Array ( 4, 5, 6, 7, 8, 9, 10 );
fisherYates(sufflepics);
var A = '<li class="frontpics"><img src="images/front_pics';
var B = '.jpg" width="348" height="257" /></li>';

var Randompics_str = '';
   Randompics_str += A + sufflepics[0] + B + "\n";
   Randompics_str += A + sufflepics[1] + B + "\n";
   Randompics_str += A + sufflepics[2] + B + "\n";
   
   
   
console.log('%s',Randompics_str);
}


//Menu functions
jQuery(function(){
	jQuery('ul.sf-menu').superfish({
	        delay:       200,                               // 200ms delay on mouseout 
	        animation:   {opacity:'show',height:'show'},    // fade-in and slide-down animation 
	        speed:       'medium',                          // animation speed
	        autoArrows:  true,                              // disable generation of arrow mark-up 
            dropShadows: true                               // disable drop shadows 
	        });
	});
          
