function init(qs){
writeSelects(qs);



var re=new RegExp("gsearcher.asp");
	if(qs.match(re)){
		doSearch(searchTerm);
	}
}

function popcount(el){
document.getElementById("datapump").src="/lib/popcount.asp?s="+el.href;
return true;
}
var ranonce=false;

function doSearch(_4){
	if(ranonce==false){
		var _5=new GSearchControl();
		suncoast=new GwebSearch();
		suncoast.setSiteRestriction("008000895762949242946:k4w7nbl5fwc");
		suncoast.setUserDefinedLabel("Sunshine Coast");
		suncoastCentral=new GwebSearch();
		suncoastCentral.setSiteRestriction("suncoastcentral.com");
		suncoastCentral.setUserDefinedLabel("SuncoastCentral.com");
		_5.addSearcher(suncoast);
		_5.addSearcher(new GwebSearch());
		_5.addSearcher(suncoastCentral);
		var _6=new GdrawOptions();
		_6.setDrawMode(GSearchControl.DRAW_MODE_TABBED);
		_5.draw(document.getElementById("search_control_tabbed"),_6);
		_5.execute(_4);
		GSearch.setOnLoadCallback(doSearch);
		ranonce=true;
	}

}

function setActiveStyleSheet(_7){
var i,a,main;
for(i=0;(a=document.getElementsByTagName("link")[i]);i++){
if(a.getAttribute("rel").indexOf("style")!=-1&&a.getAttribute("title")){
a.disabled=true;
if(a.getAttribute("title")==_7){
a.disabled=false;
}
}
}
}
function gourl(_9){
var _a=_9[_9.selectedIndex].value;
var winref
location.href=_a

}

var popupWin;
function go(_b){
var _c=_b[_b.selectedIndex].value;
var _d;
if(_c!=""){
if(popupWin&&popupWin.open&&!popupWin.closed){
popupWin.close();
}
if(_c.indexOf("http:")==0){
maxW=self.screen.availWidth-10;
maxH=self.screen.availHeight-25;
popupWin=window.open(_c,"","width="+maxW+",scrollbars=yes,height="+maxH+",status=yes,toolbar=yes,menubar=yes");
}else{
document.location=_c;
}
}
_b.selectedIndex=0;
}
function validate_replybymail(){
var _e=1;
var _f="";
var re;
if(document.getElementById("replymessage").value==""){
_e=0;
_f=_f+"Please enter a message to send.\n";
}
if(document.getElementById("verification").value==""){
_e=0;
_f=_f+"Please enter the verification number displayed in the image.\n";
}
if(_e==0){
alert(_f);
return false;
}else{
return true;
}
}
function validate_contactus(){
var _11=1;
var _12="";
var re;
if(document.getElementById("name").value==""){
_11=0;
_12=_12+"Please enter your name.\n";
}
if(document.getElementById("email").value==""){
_11=0;
_12=_12+"Please enter an email address so that we may reply to your message.\n";
}else{
re=/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,})+$/;
if(!re.test(document.getElementById("email").value)==true){
_11=0;
_12=_12+"Your email address does not appear to be valid.\n";
}
}
if(document.getElementById("details").value==""){
_11=0;
_12=_12+"Please enter a message.\n";
}
if(document.getElementById("verification").value==""){
_11=0;
_12=_12+"Please enter the verification number displayed in the image.\n";
}
if(_11==0){
alert(_12);
return false;
}else{
return true;
}
}
function validate_outdoorreport(){
var _14=1;
var _15="";
var re;
if(document.getElementById("name").value==""){
_14=0;
_15=_15+"Please enter your name.\n";
}
if(document.getElementById("email").value==""){
_14=0;
_15=_15+"Please enter an email address in case we need to contact you regarding this message.\n";
}else{
re=/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,})+$/;
if(!re.test(document.getElementById("email").value)==true){
_14=0;
_15=_15+"Your email address does not appear to be valid.\n";
}
}
if(document.getElementById("reporttype").selectedIndex==0){
_14=0;
_15=_15+"Please select a report type.\n";
}
if(document.getElementById("title").value==""){
_14=0;
_15=_15+"Please a title for your message.\n";
}
if(document.getElementById("verification").value==""){
_14=0;
_15=_15+"Please enter the verification number displayed in the image.\n";
}
if(_14==0){
alert(_15);
return false;
}else{
return true;
}
}

function validate_classifiedform(){
var _17=1;
var _18="";
var re;
if(document.getElementById("email").value==""){
_17=0;
_18=_18+"Please enter an email address in case we need to contact you regarding your classified.\n";
}else{
re=/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,})+$/;
if(!re.test(document.getElementById("email").value)==true){
_17=0;
_18=_18+"Your email address does not appear to be valid.\n";
}
}
if(document.getElementById("classification").selectedIndex==0){
_17=0;
_18=_18+"Please select a classification for your ad.\n";
}
if(document.getElementById("title").value==""){
_17=0;
_18=_18+"Please a title for your ad.\n";
}
if(document.getElementById("verification").value==""){
_17=0;
_18=_18+"Please enter the verification number displayed in the image.\n";
}
if(_17==0){
alert(_18);
return false;
}else{
return true;
}
}

function validate_letterform(){
var _17=1;
var _18="";
var re;

if(document.getElementById("name").value==""){
_17=0;
_18=_18+"Please include your name.\n";
}
if(document.getElementById("email").value==""){
_17=0;
_18=_18+"Please enter an email address in case we need to contact you regarding your letter.\n";
}else{
re=/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,})+$/;
if(!re.test(document.getElementById("email").value)==true){
_17=0;
_18=_18+"Your email address does not appear to be valid.\n";
}
}

if(document.getElementById("title").value==""){
_17=0;
_18=_18+"Please a title for your letter.\n";
}
if(document.getElementById("details").value==""){
_17=0;
_18=_18+"Please include the body of your letter.\n";
}
if(document.getElementById("verification").value==""){
_17=0;
_18=_18+"Please enter the verification number displayed in the image.\n";
}
if(_17==0){
alert(_18);
return false;
}else{
return true;
}
}


function validate_commentform(){
var _17=1;
var _18="";
var re;

if(document.getElementById("name").value==""){
_17=0;
_18=_18+"Please include your name.\n";
}
if(document.getElementById("email").value!=""){
	re=/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,})+$/;
	if(!re.test(document.getElementById("email").value)==true){
	_17=0;
	_18=_18+"Your email address does not appear to be valid.\n";
	}
}

if(document.getElementById("comment").value==""){
	_17=0;
	_18=_18+"Please include the body of your comment.\n";
}
if(document.getElementById("verification").value==""){
_17=0;
_18=_18+"Please enter the verification number displayed in the image.\n";
}
if(_17==0){
alert(_18);
return false;
}else{
return true;
}
}



function writeSelects(qs){
try{
var el=document.getElementById("bset2");
//el.innerHTML="<ul style='color:#000099;list-style:none;'><li><a name='screensize'><select id='screens'  name='screens' onchange='gourl(this)' style='width:120px;'><option class='selectopt' value=''>Screen Size</option><option class='selectopt' value='http://www.suncoastcentral.com"+qs+"'>Full Size</option><option class='selectopt' value='http://www2.suncoastcentral.com"+qs+"'>800x600</option><option class='selectopt' value='http://www3.suncoastcentral.com"+qs+"'>PDA</option></select></a></li></ul>";
el.innerHTML=el.innerHTML+"<ul style='color:#000099;list-style:none;'><li><a name='submissions'><select id='quicklinks'  name='quicklinks' onchange='gourl(this)' style='width:120px;'><option class='selectopt' value=''>Submissions</option><option class='selectopt' value='/contact-us-form.asp?ns=1'>Submit a Site</option><option class='selectopt' value='/postclassifiedform.asp'>Post a Classified</option>    <option class='selectopt' value='/postletterform.asp'>Submit a Letter</option><option class='selectopt' value='/posteventform.asp'>Post an Event</option><option class='selectopt' value='/newoutdoorreport.asp'>Add a Back Country Report</option><option class='selectopt' value='/contact-us-form.asp'>Contact Us</option></select></a></li></ul>";
//el.innerHTML=el.innerHTML+"<ul style='color:#000099;list-style:none;'><li><a name='Sunshine Coast Radio'><select id='quicklinks'  name='quicklinks' onchange='gourl(this)' style='width:120px;'><option class='selectopt' value=''>Coast Radio</option><option class='selectopt' value='mms://wm16.spacialnet.com/ckay-fm'>CKAY FM Live</option><option class='selectopt' value='mms://azulweb.streamguys.com/cvuefm-wms.asx'>CVUE FM Live</option></select></a></li></ul>";

}
catch(e){
}
}


//Google map code
var iw;
var map;
function initmap() {
	iw = new google.maps.InfoWindow();
	var myOptions = {
    	zoom: 10,
	    center: new google.maps.LatLng( 49.4215628561104, -123.642990589142),
    	mapTypeId: google.maps.MapTypeId.ROADMAP
	}
	var canvas = document.getElementById("map_canvas")
	map = new google.maps.Map(canvas,myOptions);
	setMarkers(entries);
	var neBound =  new google.maps.LatLng(neLat,neLng)
	var swBound =  new google.maps.LatLng(swLat,swLng)
	var bounds = new google.maps.LatLngBounds(swBound, neBound)
	map.fitBounds(bounds)
	map.center =  bounds.getCenter()
 canvas.style.display='block';
}



function setMarkers(locations) {
  var shadow = new google.maps.MarkerImage('http://www.google.com/mapfiles/shadow50.png',
      new google.maps.Size(37, 32),
      new google.maps.Point(0,0),
      new google.maps.Point(0, 32)); 
  var shape = {
      coord: [1, 1, 1, 20, 18, 20, 18 , 1],
      type: 'poly'
  };
  for (var i = 0; i < locations.length; i++) {
	var entry = locations[i];
    var myLatLng = new google.maps.LatLng(entry[1], entry[2]);
	var image = new google.maps.MarkerImage('images/markers/marker'+ entry[3] +'.png',
      new google.maps.Size(20, 32),
      new google.maps.Point(0,0),
      new google.maps.Point(0, 32));

    var marker = new google.maps.Marker({
        position: myLatLng,
        map: map,
        shadow: shadow,
        icon: image,
        shape: shape,
        title: entry[0],
        zIndex: entry[3]
    });
	
	createMyInfoWindow(marker,entry[4])
  }
}

function createMyInfoWindow(mymarker,mycontent) {
	google.maps.event.addListener(mymarker, 'click', function(){iw.setContent(mycontent);iw.open(map, mymarker);});
}


