if(typeof jQuery =='function'){
jQuery(function(){
 
     $hrefElement = jQuery('[href^=http],img,[action^=http]');
      
      $hrefElement.each(function(){
        $this =jQuery(this);
        if(typeof $this.attr('href')=='string')
         $attr  ='href';
          else if(typeof $this.attr('src')=='string')  
            $attr  ='src'; 
       else if(typeof $this.attr('action')=='string')  
            $attr  ='action'; 
           
           
        $href = $this.attr($attr);
       if(typeof $href !='undefined'){ 
           if($href.indexOf('https')<0 && $href.indexOf('tailor')<0 && $href.indexOf('cart')<0){
               $hrefN = $href.replace(/http/i, "https"); 
               $this.attr($attr,$hrefN); 
               
           }
       }
      } );
});
}else{   
 Event.observe(window,'load',function(){
    $domElement = $$('[href^=http],[src^=http],[action^=http]');
      $domElement.each(function(item){
        $this =item;
        if( $this.readAttribute('href')!=null)
         $attr  ='href';
          else if($this.readAttribute('src')!=null)
            $attr  ='src'; 
        else if($this.readAttribute('action')!=null) 
           $attr  ='action';    
        $href = $this.readAttribute($attr);
        
       if( $href !='undefined'){ 
           if(window.location.protocol.indexOf('https')>-1 ||  ($href.indexOf('login')>0 || $href.indexOf('create_account')>0 || 
$href.indexOf('account')>0  || $href.indexOf('checkout_confirmation')>0 
|| $href.indexOf('checkout')>0  || $href.indexOf('checkout-shipping')>0 )  ){
              if($href.indexOf('https')<0 && $href.indexOf('japanphoto')>0)    {
               $hrefN = $href.replace(/http/i, "https"); 
               $this.writeAttribute($attr,$hrefN); }
                
           }
       }
      } );                                                                                                               
  });
}       
                                 
  
if(window.location.protocol.indexOf('https')<0 && (window.location.href.indexOf('login')>0 ||  window.location.href.indexOf('create_account')>0 || 
window.location.href.indexOf('account')>0  || window.location.href.indexOf('checkout_confirmation')>0 
|| window.location.href.indexOf('checkout')>0  || window.location.href.indexOf('checkout_shipping')>0 )){     
        window.location.href=window.location.href.replace(/http(s+)?/i,'https');
        
}else if(window.location.protocol.indexOf('https')==0 && !(window.location.href.indexOf('login')>0 ||  window.location.href.indexOf('create_account')>0 || 
window.location.href.indexOf('account')>0  || window.location.href.indexOf('checkout_confirmation')>0 
|| window.location.href.indexOf('checkout')>0  || window.location.href.indexOf('checkout_shipping')>0 )){   
  window.location.href=window.location.href.replace(/http(s+)?/i,'http');  
}
