﻿        hs.graphicsDir = 'highslide/graphics/';
        hs.captionId = 'the-caption';
        hs.outlineType = 'rounded-black';        
        //hs.outlineType = 'rounded-white';
        hs.wrapperClassName = 'draggable-header';

        function countryclick(countryid){            
            var ifr = parent.document.getElementById("iframe_rightcontent");
            //ifr.src = 'quicklinks.aspx?countryid=' + countryid;
            ifr.src = 'mainadvertising.aspx?countryid=' + countryid;
            //ifr.SetLanguage();
            //var i   = ifr.document.getElementById("iframe_QuickLinks");
            //.document.getElementById("iframe_QuickLinks");
            //i.src = 'quicklinks.aspx?countryid=' + countryid;
        }
        // Show Clasified
        function closeClubEvents(id){
         //alert(id);
            closepopup();
            loadclubdata(id);
        }
        function closepopup(){
            var obj = document.getElementById("fishhis"); 
            return hs.close(obj)
        }
        function advertisehere(id){
            
            var obj = document.getElementById('PopupIframe');
            obj.innerHTML = 'Advertise Here';
            
            obj = document.getElementById("fishhis"); 
            var n = 'advertisehere.aspx?clubid=' + id + '';       
            obj.src = n;            
            var obja = document.getElementById("img1");         
            setTimeout(hs.htmlExpand(obja, { contentId: 'fishhistory' } ),2250);
        
        }
        
        function editclassified(id){
            
            var obj = document.getElementById('PopupIframe');
            obj.innerHTML = 'Advertise Here';
            
            obj = document.getElementById("fishhis"); 
            var n = 'advertisehere.aspx?classifiedid=' + id + '';       
            obj.src = n;            
            var obja = document.getElementById("img1");         
            setTimeout(hs.htmlExpand(obja, { contentId: 'fishhistory' } ),2250);
        
        }
        
        function showclassified(id){
                         
            var obj = document.getElementById('PopupIframe');
            obj.innerHTML = 'Classified';
            
            obj = document.getElementById("fishhis"); 
            var n = 'classified.aspx?id=' + id + '';       
            obj.src = n;            
            var obja = document.getElementById("img1");         
            setTimeout(hs.htmlExpand(obja, { contentId: 'fishhistory' } ),2250);
            
        }
    
        // Resize Popup Window
        function WindowResize(){    
            /*
            var obj = document.getElementById("idpopup");
            var nW  = ((pageWidth() /2)-300) + 'px';           
            obj.style.left = nW;
            */
            alert('resize old code');                        
        }
        
                         
        // Flash transpose menu selector
        function menuclick(id) {        
            if (document.getElementById("ifHeader").src != 'countries.aspx') {                        
                document.getElementById("ifHeader").src = 'countries.aspx';
            }
            
            if (document.getElementById("iframe_rightcontent").src != 'mainadvertising.aspx'){
            document.getElementById("iframe_rightcontent").src = 'mainadvertising.aspx';  
            }
            HideShowRegNow(id);
            switch (id){
                case 1: setTimeout("document.getElementById('contentframe').src ='home.aspx'",0);   // Home
                break;
                case 2: setTimeout("document.getElementById('contentframe').src= 'gallery.aspx'",0); // Gallery
                break;
                case 3: setTimeout("document.getElementById('contentframe').src= 'calendar.aspx'",0); // Buy & Sell
                break;            
                case 4: setTimeout("document.getElementById('contentframe').src= 'blogspot/index.aspx'",0); // Forums
                break;            
                case 5: setTimeout("document.getElementById('contentframe').src= 'helpandabout.aspx'",0); // help & about
                break;
                default: setTimeout("document.getElementById('contentframe').src ='home.aspx'",0);  // Default
                }
        }
        
        // Refresh the add photo page
        function RefreshPhotoUploader(clubid){            
            setTimeout("document.getElementById('contentframe').src ='photouploader.aspx?clubid=" + clubid + "'",100);
        }
        
        // Refresh the club grid map
        function RefreshClubMap(clubid){            
            setTimeout("document.getElementById('contentframe').src ='gridmap.aspx?clubid=" + clubid + "'",100);
        }
        
        // Hide a Highslide popup element    
        function hideitemdata(){
            var obj = document.getElementById("itemdata");
            return hs.close(obj);
        }

        // Show a Highslide popup element
        function showitemdata(itemid){
            var obj = document.getElementById("iframeitemdata"); 
            var n = 'buyandsell/itemdata.aspx?itemid=' + itemid + '';       
            obj.src = n;        
            var obja = document.getElementById("itemdata");         
            setTimeout(hs.htmlExpand(obja, { contentId: 'itemdata' } ),2250);
        }
        
        // Custom Popup in IFrame
        function customformattedpopup(url,title,width){
            var obj = document.getElementById('PopupIframe');
            obj.innerHTML = title;
            
            obj = document.getElementById("fishhistory");
            //obj.style.width = width;
            
            obj = document.getElementById("fishtable");
            //obj.style.width = width;
            
            obj = document.getElementById("fishhis"); 
            //obj.style.width = width;
            obj.src = url;
            var obja = document.getElementById("img1");         
            setTimeout(hs.htmlExpand(obja, { contentId: 'fishhistory' } ),2250);
        
        }
        
        function resetpopup(){
            /*
            document.getElementById("fishhis").style.width = 340;    
            document.getElementById("fishtable").style.width = 340;    
            document.getElementById("fishhistory").style.width = 340;                                                                                    
            document.getElementById("img1").style.width = 340;                                                
            */
        }
        
        // Popup in IFrame
        function formattedpopup(url,title){
            var obj = document.getElementById('PopupIframe');
            resetpopup();
            obj.innerHTML = title;                                     
            obj = document.getElementById("fishhis");            
            obj.src = url;
            var obja = document.getElementById("img1");         
            setTimeout(hs.htmlExpand(obja, { contentId: 'fishhistory' } ),2250);
        
        }
        
        // Disaply the fish catch data popup        
        function showcatchdata(griddataid, fishtypeid, startdate, enddate){     
            var obj = document.getElementById('PopupIframe');
            obj.innerHTML = 'Historical Catch Data';             
            
            
            obj = document.getElementById("fishhis"); 
            var n = 'catchdata.aspx?griddataid=' + griddataid + '&fishtypeid=' + fishtypeid + '&startdate=' + startdate + '&enddate='+enddate;       
            obj.src = n;            
            var obja = document.getElementById("img1");         
            setTimeout(hs.htmlExpand(obja, { contentId: 'fishhistory' } ),2250);
           }      
        
        // Highslide popup with URL redirect
        function popup(url) {                 
            resetpopup();
           var obj = document.getElementById("img1");                           
           obj.href = url;      
           return hs.expand(obj);
        }    
        
        // Load and display club data into the left frame    
        function loadclubdata(id){
            //alert('loadcd');
            var obj = document.getElementById("ifHeader");        
            obj.src = "contentleft.aspx?clubid=" + id;               
            obj.style.visibility='visible';
            
            // Load and siaply classified data into the right frame
            obj = document.getElementById("iframe_rightcontent");
            obj.src = "clubspecificadvertising.aspx?clubid=" + id;
            obj.style.visibility='visible';
        }                
        // Resize the content iFrame to match the correct content height        
        function ResizeIFrame(ht){            
            //var iFrame = document.getElementById("contentframe")
            //iFrame.style.height = ht;           
            //alert('ResizeIFrame');
        }    
        
        function ResizeIFrameW(w){
            
            var iFrame = document.getElementById("contentframe")
            iFrame.style.width = w;           
            alert('ResizeIFrameW');
        }    
        
        function SignIn(){
            setTimeout("document.getElementById('contentframe').src ='login.aspx'",0);
        }   
        function Register(){
            setTimeout("document.getElementById('contentframe').src ='register.aspx'",0);
        }   
        
  
    
    // hide / show popup
    
    function HideShowRegNow(value){
       var obj = document.getElementById("signupnow");
      
       if (value<=1){       
        obj.style.visibility = 'visible';
        }
        else{
            obj.style.visibility = 'hidden';
        }    
    }    