﻿
    function isNewsSeek(){
        
        var element;
        
        element = document.newsseek;
        
        if( element.q.value.trim().length < 2){
            
            alert('請輸入關鍵字進行文章搜尋！');
            
            element.q.focus();
            
            return false;
            
        }
        
    }

    function loadDefaultImage( element){

        element.src = './images/default-thumb.jpg';
        
    }
    
    function sendFacebook(){
        
       u = location.href;
       t = document.title;
       
       window.open('http://www.facebook.com/sharer.php?u='+encodeURIComponent(u)+'&t='+encodeURIComponent(t),'sharer','toolbar=0,status=0,width=650,height=420');
       
       return false;
        
    }
    
    function sendPlurk(){
        
        window.open('http://www.plurk.com/?qualifier=shares&status='  .concat(' ') .concat(' ') .concat(encodeURIComponent(location.href)) .concat(' ') .concat('&#40;') .concat(encodeURIComponent(document.title)) .concat('&#41;'));
        
    }
    
    function sendTwitter(){
        
        window.open('http://twitter.com/home/?status='.concat(encodeURIComponent(document.title)) .concat(' ') .concat(encodeURIComponent(location.href)));
        
    }
    
    function sendPageView(){

        try{
        
            document.getElementById('sendpv').contentDocument.location.reload();
        
        }
    
        catch(e){
            
        }
        
    }

    function sendAdvPageView(){

        try{
        
            document.getElementById('sendadvpv').contentDocument.location.reload();
        
        }
    
        catch(e){
            
        }
        
    }
    
    function refreshAdvLink(){

        try{

            if( document.getElementById('adv_images_l')){
                
                document.getElementById('adv_images_l').innerHTML = document.getElementById('adv_images_l').innerHTML;
                
            }
    
            if( document.getElementById('adv_images_s')){
            
                document.getElementById('adv_images_s').innerHTML = document.getElementById('adv_images_s').innerHTML;
                
            }
            
            sendAdvPageView();
        
        }
        
        catch(e){
            
            
        }
        
    }   
