if (document.getElementById){ 
document.write('<style type="text/css">\n')
document.write('.submenu{display: none;}\n')
document.write('</style>\n')
}

function SwitchMenu(obj){
	if(document.getElementById){
	var el = document.getElementById(obj);
	var ar = document.getElementById("masterdiv").getElementsByTagName("span"); 
		if(el.style.display != "block"){ 
			for (var i=0; i<ar.length; i++){
				if (ar[i].className=="submenu") 
				ar[i].style.display = "none";
			}
			el.style.display = "block";
		}else{
			el.style.display = "none";
		}
	}
}

function get_cookie(Name) {
  var search = Name + "=";
  var returnvalue = "";
  if (document.cookie.length > 0) {
    offset = document.cookie.indexOf(search);
    // if cookie exists
    if (offset != -1) { 
      offset += search.length;
      // set index of beginning of value
      end = document.cookie.indexOf(";", offset);
      // set index of end of cookie value
      if (end == -1) end = document.cookie.length;
      returnvalue=unescape(document.cookie.substring(offset, end));
      }
   }
  return returnvalue;
}

function checkit()
{
  var i=0;
  var m_num = 1;
  var s_num = 1;
  do {
   if (menu_item[i][1] == 'submenu0')
   {
     menustring = 'menu0_' + m_num;
     m_num++;
	   menu = document.getElementById(menustring);
	   if (menu.style.display == 'block'){
       openones = openones + " " + menustring;
     }
   }
   else if  (menu_item[i][1] == 'submenu1')
   {
     menustring = 'menu1_' + s_num;
     s_num++;
	   menu = document.getElementById(menustring);
	   if (menu.style.display == 'block'){
       openones = openones + " " + menustring;
     }
   }
  } while (++i < menu_item.length);
  document.cookie='pvg'+"="+openones;
}


//______LEFT CONTENT MANAGER__________________________
//Use this script to edit and generate content for the left sidebar

var start_printer_hide = '<div class="printer-hide">';//This prevents the menu from being shown during printing
var end_printer_hide= '</div>';
var menu_header = '<div class="nav-header">Menu</div>';
var start_menu = '<div id="menu">';
var end_menu= '</div>';
var menu_item = new Array();

//______ADD A MENU ITEM_______________________________
//Add a new link to the menu here by adding a new line of the form 	['filename.file ext','css class name','display name'],
//Insert it where you would like to see it displayed.
menu_item= [
			['index.html','linktitle','Home'],
      
      ['', 'menutitle', 'Golf Packages'],
			['golf-travel-package.html', '', 'Golf Packages'],
			['discount-golf-vacation-package.html', '', 'Golf Package Tips'],
			['golf-vacation-deal.html', '', 'Golf Package Deals'],
			['ladies-golf-vacation.html', '', 'Ladies Golf Vacation'],
			['cheap-golf-vacations.html', '', 'Cheap Golf Vacations'],
			
			['', 'menutitle', 'Myrtle Beach'],
      ['golf-in-myrtle-beach.html', '', 'Golf Myrtle Beach'],
      ['myrtle-beach-golf-listings.html', '', 'Golf Courses'],
      ['myrtle-beach-tee-times.html', '', 'Golf Tee Times'],			
      ['myrtle-beach-golf-package.html', '', 'Golf Packages'],
      ['myrtle-beach-golf-schools.html', '', 'Golf Schools'],			
      ['myrtle-beach-golf-shops.html', '', 'Golf Stores'],
      ['myrtle-beach-sc-airport.html', '', 'Getting There'],			
      ['myrtle-beach-sc-accommodations.html', '', 'Accommodations'],
      ['golf-vacation-myrtle-beach.html', '', 'Everything Myrtle'],			
      ['myrtle-beach-sc-weather.html', '', 'Weather'],
			
			['', 'menutitle', 'North Carolina'],
      ['north-carolina-golf-vacation.html', '', 'Golf North Carolina'],
			['north-carolina-golf-vacation-package.html', '', 'Golf Packages'],
			['charlotte-golf-vacation.html', '', 'Charlotte'],
			['asheville-golf.html', '', 'Asheville'],
			['golf-vacation-pinehurst.html', '', 'Pinehurst'],
			['north-carolina-golf-packages.html', '', 'Raleigh'],
			['brunswick-county-golf-package-vacation.html', '', 'Brunswick County'],
			['golf-packages-north-carolina.html', '', 'Fayetteville'],
			['golf-packages-in-north-carolina.html', '', 'Sandhills'],

      ['', 'menutitle', 'Nevada'],
			['nevada-golf-vacation.html','','Golf Nevada'],
			['vacation-golf-las-vegas.html','','Golf Las Vegas'],
      ['las-vegas-golf-course.html', '', 'Golf Courses'],
      ['las-vegas-golf-reservation.html', '', 'Golf Tee Times'],
      ['golf-packages-in-las-vegas.html', '', 'Golf Packages'],
      ['las-vegas-golf-school.html', '', 'Golf Schools'],
      ['las-vegas-golf-lessons.html', '', 'Golf Instruction'],
			['golf-store-las-vegas.html', '', 'Golf Stores'],
      ['mccarran-airport-las-vegas.html', '', 'Getting There'],
      ['las-vegas-accommodations.html', '', 'Accommodations'],
      ['las-vegas-nevada-entertainment.html', '', 'Everything Vegas'],			
			['las-vegas-nevada-weather.html', '', 'Weather'],
			['mesquite-nevada-golf-vacation.html', '', 'Golf Mesquite'],

      ['', 'menutitle', 'Hilton Head'],
      ['hilton-head-golf-vacation.html', '', 'Golf Hilton Head'],
			['hilton-head-golf-courses.html', '', 'Golf Courses'],
			['hilton-head-golf-package.html', '', 'Golf Packages'],
			['hilton-head-golf-school.html', '', 'Golf Schools'],
			['hilton-head-golf-shop.html', '', 'Golf Stores'],
			['hilton-head-south-carolina-weather.html', '', 'Weather'],
			
			['', 'menutitle', 'Charleston'],
      ['charleston-golf.html', '', 'Golf Charleston'],
			['charleston-sc-public-golf-courses.html', '', 'Golf Courses'],
			['charleston-south-carolina-golf-vacation.html', '', 'Golf Packages'],
			['south-carolina-golf-school-destination.html', '', 'Golf Schools'],
			['charleston-golf-store.html', '', 'Golf Stores'],
			['best-hotel-deals-charleston-south-carolina.html', '', 'Accommodations'],
			['things-see-and-do-charleston.html', '', 'Everything Charleston'],
			['charleston-south-carolina-weather.html', '', 'Weather'],
			['charleston-investment-property.html', '', 'Real Estate'],
			
			['', 'menutitle', 'Kiawah Island'],
			['kiawah-south-carolina.html', '', 'Golf Kiawah'],
			['kiawah-golf-courses.html', '', 'Golf Courses'],
      ['kiawah-golf-packages.html', '', 'Golf Packages'],
			['kiawah-island-condo-rentals.html', '', 'Accommodations'],
			
			['', 'menutitle', 'Arizona'],
			['arizona-golf-vacation.html', '', 'Golf Arizona'],
			['arizona-golf-package.html', '', 'Golf Packages'],
			['arizona-golf-courses.html', '', 'Golf Courses'],
			
			['', 'menutitle', 'Florida'],
			['golf-vacations-in-florida.html', '', 'Golf Florida'],
			['florida-golf-package.html', '', 'Golf Packages'],
			
			['', 'menutitle', 'Alabama'],
			['alabama-golf-vacations.html', '', 'Golf Alabama'],
			['alabama-golf-package.html', '', 'Golf Packages'],
			
			['', 'menutitle', 'Georgia'],
			['georgia-golf-vacations.html', '', 'Golf Georgia'],
			['golf-vacation-package-atlanta.html', '', 'Atlanta'],
			['georgia-golf-packages.html', '', 'Jekyll Island'],
			['georgia-golf-package.html', '', 'Reynolds Plantation'],
			
			['', 'menutitle', 'Texas'],
			['austin-texas-golf-courses.html', '', 'Golf Courses'],
			['golf-packages-texas.html', '', 'Golf Packages'],
			
			['', 'menutitle', 'Mississippi'],
			['mississippi-golf-vacation.html', '', 'Golf Mississippi'],
			['biloxi-golf-package.html', '', 'Biloxi Golf Packages'],
			
			['', 'menutitle', 'Virginia'],
			['virginia-golf-vacations.html', '', 'Golf Virginia'],
			['virginia-golf-packages.html', '', 'Golf Packages'],
			
			['', 'menutitle', 'Maryland'],
			['maryland-golf-vacations.html', '', 'Golf Maryland'],
			['ocean-city-maryland-golf-packages.html', '', 'Golf Packages'],
			
			['', 'menutitle', 'New Jersey'],
			['new-jersey-golf-vacation.html', '', 'Golf New Jersey'],
			['atlantic-city-golf-packages.html', '', 'Atlantic City'],
			['new-jersey-golf-packages.html', '', 'Crystal Springs Resort'],
			
			['', 'menutitle', 'California'],
			['california-golf-vacation.html', '', 'Golf California'],
			['golf-packages-california.html', '', 'Golf Packages'],
			
			['', 'menutitle', 'Mexico'],
			['golf-vacations-in-mexico.html', '', 'Golf Mexico'],
			['mexico-golf-vacation-package.html', '', 'Golf Packages'],
			
			['', 'menutitle', 'Jamaica'],
			['jamaica-golf-vacations.html', '', 'Golf Jamaica'],
			['jamaica-golf-packages.html', '', 'Golf Packages'],
			['jamaica-golf-resorts.html', '', 'Golf Resorts'],
			['golf-courses-in-jamaica.html', '', 'Golf Courses'],
			
			['', 'menutitle', 'Dominican Republic'],
			['dominican-republic-vacation-packages.html', '', 'Golf DR'],
			['golf-packages-dominican-republic.html', '', 'Golf Packages'],
			['dominican-republic-travel-tips.html', '', 'Travel Tips'],
			['dominican-republic-pictures.html', '', 'Pictures'],
			['facts-about-dominican-republic.html', '', 'Facts'],
			
			['', 'menutitle', 'Hawaii'],
      ['hawaii-golf-vacation.html', '', 'Golf Hawaii'],
			['best-golf-course-in-hawaii.html', '', 'Golf Courses'],
			['hawaii-weather.html', '', 'Weather'],
			
			['', 'menutitle', 'Bermuda'],
      ['bermuda-golf-vacations.html', '', 'Golf Bermuda'],
			['bermuda-golf-package.html', '', 'Golf Packages'],
			['bermuda-golf-courses.html', '', 'Golf Courses'],
			
			['', 'menutitle', 'Golf Resources'],
      ['golf-tournaments.html', '', 'Golf Schedule/Tickets'],
			['proper-golf-swing.html', '', 'Play Better Golf'],
			['golf-equipment-reviews.html', '', 'Golf Equipment Reviews'],
			
			['golf-vacation-schools.html', 'linktitle', 'Golf Vacation Schools'],
			['the-perfect-golf-vacations-blog.html','linktitle','Blog'],
			['perfect-golf-vacations-sitesearch.html','linktitle','SiteSearch'],
			['about-us.html', 'linktitle', 'About Us'],
			['contact-perfect-golf-vacations.html','linktitle','Contact Us']
			
			];


var whats_new_header= '<div class="nav-header">Perfect Golf Vacations Highly Recommends</div>';
var new_item = new Array();
//______ADD A WHATS NEW ITEM_______________________________
new_item=	[

['http://www.perfectgolfvacations.com/objects/rss.jpg','14','72', 'link-list2','http://www.perfectgolfvacations.com/perfect-golf-vacations.xml','Right Click to Subscribe',' '],

['http://www.perfectgolfvacations.com/image-files/mymsn.gif','18','72', 'link-list2','http://my.msn.com/addtomymsn.armx?id=rss&ut=http://www.perfectgolfvacations.com/perfect-golf-vacations.xml&ru=http://www.perfectgolfvacations.com','Click to Subscribe',' '],

['http://us.i1.yimg.com/us.yimg.com/i/us/my/addtomyyahoo2.gif','18','104', 'link-list2','http://add.my.yahoo.com/rss?url=http://www.perfectgolfvacations.com/perfect-golf-vacations.xml','Click to Subscribe',' '],

['http://www.perfectgolfvacations.com/image-files/add-to-google-plus.gif','18','104', 'link-list2','http://fusion.google.com/add?feedurl=http://www.perfectgolfvacations.com/perfect-golf-vacations.xml','Click to Subscribe',' '],

['http://www.perfectgolfvacations.com/objects/ngsub1.gif','18','104', 'link-list2','http://www.newsgator.com/ngs/subscriber/subext.aspx?url=http://www.perfectgolfvacations.com/perfect-golf-vacations.xml','Click to Subscribe',' '],

['http://www.perfectgolfvacations.com/objects/bloglines.gif','17','91', 'link-list2','http://www.bloglines.com/sub/http://www.perfectgolfvacations.com/perfect-golf-vacations.xml','Click to Subscribe',' '],

['http://www.perfectgolfvacations.com/image-files/orlando-golf-course-tnlarge.jpg','90','120', 'link-list2','http://www.golfzoo.com/-pl-240-.htm','Plan, Customize and Book Your Perfect Golf Vacation. CLICK HERE to Get Started',' '],

['http://affiliates.tripadvisor.com/42/965/20','125','125', 'link-list2','http://www.tripadvisor.com/Home-m10556-a_aid.CD965-a_src.20?bid=20&aid=CD965&opt=','Click Here for Unbiased Reviews and Hot Deals',' ']
			
			];

function mailpage()
{
		mail_str = "mailto:?subject=Check out the " + document.title;
		mail_str += "&body=I thought you might be interested in " + document.title;
		mail_str += ". You can view it at, " + location.href; 
		location.href = mail_str;
}

function addBookmark() 
{ 
			var msg = "Don't forget to bookmark us!";
			if(navigator.appName == "Netscape") {
			msg += "  (CTRL-D)";
			alert(msg);
			}

			if( window.sidebar && window.sidebar.addPanel ) {
					window.sidebar.addPanel( this.title, this.href, '' );
			} else if( window.external && ( navigator.platform == 'Win32' ||
				  ( window.ScriptEngine && ScriptEngine().indexOf('InScript') + 1 ) ) ) {
					window.external.AddFavorite( location.href, document.title );
			} else if( window.opera && window.print ) {
				return true;
			} else if( document.layers ) {
				window.alert( 'Please click OK then press Ctrl+D to create a bookmark' );
			} else {
				window.alert( 'Please use your browser\'s bookmarking facility to create a bookmark' );
			}
			return false;
}



function write_menu()
{
  var content = start_printer_hide ;
  var i=0;
  var snum = 1;
  content += '<div id="masterdiv" style="padding:0px; margin:0px;">';

  content += '<table summary="" width="150" cellpadding="0" cellspacing="0" >';
  content += '<tr><td><img src="image-files/pixel_trans.gif" height="2" alt=""></td></tr>';

do{
  if (menu_item[i][1] == 'linktitle')
  {
    content += ' <tr><td height="23"><div class="linktitle" onmouseover="this.className=\'linktitleover\'" onclick="window.location.href=\''+menu_item[i][0]+'\'" onmouseout="this.className=\'linktitle\'"><img src="image-files/pixel_trans.gif" width="10" height="1" alt="">' + menu_item[i][2] + '</div></td></tr>';
  } 
  else if (menu_item[i][1] == 'menutitle')
  {
    content += '<tr><td  height="23">';
    if (menu_item[i][0] != '') 
    {
      content +='<a href="'+menu_item[i][0]+'" alt="">';
    }
    content += '<div class="menutitle"  onmouseover="this.className=\'menutitleover\'"  onmouseout="this.className=\'menutitle\'" onclick="SwitchMenu(\'sub'+snum+'\')"><img src="image-files/pixel_trans.gif" width="10" height="1" alt="">'+menu_item[i][2]+'&nbsp&nbsp;<img align="top" src="image-files/down_arrow.gif" align="right" alt="" ></div>';
    if (menu_item[i][0] != '') 
    {
      content +='</a>';
    }
  
    content += '   	<span class="submenu" id="sub'+snum+'">';
    snum++;  
  }
  else
  {
    content += '     		 <a href="'+ menu_item[i][0] +'">'+menu_item[i][2]+'</a><br>';
    if ((i == (menu_item.length-1)) || (menu_item[i+1][1] != '')) 
    {
      
      content += '  	</span>';
    }
  }
}while (++i < menu_item.length);

content += '   </div></td></tr>';
  content += '</table></div>';
  //loop and add new items
  content += end_printer_hide;
  
  document.write( content ) ;
}


function write_partners()
{
  var content = start_printer_hide ;
  var i=0;
  do{
       content +='<div class="left-partner">';  
  			content+='<a target="window1"  class="';
  			content+=new_item[i][3];//add css class
  			content+='" href="';
  			content+=new_item[i][4];//add file name
  			content+='">';
  			content+='<img style="border:1px solid #cccccc; padding:0px; margin:0px;" hspace="0" vspace="0" src="';
  			content+=new_item[i][0];//add image
  			content+='" height="';
  			content+=new_item[i][1];//add image height
  			content+='" width="';
  			content+=new_item[i][2];//add image width
  			content+='"><br>';
  			content+=new_item[i][5];//add display name (title of page)
  			content+='</a><br>';
  			content+=new_item[i][6];//add excerpt
  			content += '</div>';
  	}while (++i < new_item.length);
  
  
  content += end_menu;
  content += '<br><br>' + end_printer_hide;
  document.write( content ) ;
}

function write_console()
{
  var content = start_printer_hide ;

    content += '<div id="console"><div style="border:2px solid white;padding: 3px 5px 5px 5px;">';
    content += '<a href="" class="tool" onclick="window.print();"><img src="image-files/print.gif" height=16 width=16 alt="Printer Friendly Version">&nbsp&nbsp;Print Page</a></br>';
    content += '<a href="javascript:mailpage();" class="tool"><img height=16 width=16 src="image-files/mail.gif" alt="Tell A Friend">&nbsp&nbsp;Tell A Friend</a></br>';
    content += '<a href="index.html" class="tool" title="PerfectGolfVacations.com" rel="sidebar" onclick="addBookmark();"><img height=16 width=16 src="image-files/favs.gif" alt="Add to Favorites">&nbsp&nbsp;Add to Favorites</a>';
    content += '</div></div>';		
  
  
  content += '<br>' + end_printer_hide;
  document.write( content ) ;
}


