// JavaScript Document

	
function sourceH(src) {
	   var orfile=src;
	var extAr=$(this).attr('src').split('.');
		var ext=extAr.pop();
		var filename=extAr;
	  if(orfile.indexOf('_h.')>=0){
		  var newName=orfile.replace('_h.','.');
	  }else{
		  var newName=filename+"_h."+ext;
	  }
	  newName=newName.replace(/,/g,".");
	  return newName;
};

function sourcePreload(src){
	var image1 = $('<img />').attr('src',src);
}
 
(function( $ ){
		  
	$.fn.preLoad = function() {
  		 var extAr=$(this).attr('src').split('.');
		var ext=extAr.pop();
		var filename=extAr;
		var newName=filename+"_h."+ext;
		newName=newName.replace(/,/g,".");
		var image1 = $('<img />').attr('src', newName);
	};

  $.fn.imH = function() {
	 	 var orfile=$(this).attr('src');
  	 	var extAr=$(this).attr('src').split('.');
		var ext=extAr.pop();
		var filename=extAr;
		if(orfile.indexOf('_h.')>=0){
			var newName=orfile.replace('_h.','.');
		}else{
			var newName=filename+"_h."+ext;
		}
		newName=newName.replace(/,/g,".");
		this.attr('src',newName);
		return this;
  };
  
  
  $.fn.hideArea = function() {
	 	$('a[href="starthide"]').each(function(){
		var $set = $();
		var nxt = this.nextSibling;
		while(nxt) {
			if(!$(nxt).is('a[href="endhide"]')) {
				$set.push(nxt);
				nxt = nxt.nextSibling;
			} else break;
		} 
	   $set.wrapAll('<div class="hiddenArea" />');
	  $(this).hide();
	 $(this).nextAll('a[href="endhide"]:first').data('opentext',$(this).html());
	});
		
		$('a[href="endhide"]').each(function(){
			$(this).data('c',$(this).prev('div.hiddenArea'));
			$(this).data('closetext',$(this).html()).html($(this).data('opentext'));
			$(this).toggle(function(){
				$.docHeight+=$(this).data('c').height()+30;
				$(this).hide();
				$(this).html($(this).data('closetext')).data('c').slideDown('fast',function(){ $(this).next('a.endhide').show();$(window).resize();});
				return false;
		  	},
			function(){
				$.docHeight-=$(this).data('c').height()-30;
				$(this).hide();
				$(this).html($(this).data('opentext')).data('c').slideUp('fast',function(){ $(this).next('a.endhide').show();$(window).resize(); });
				
				return false;
			})
		});
		
		
		$('div.hiddenArea').hide();
  };
  
$.fn.slideShow = function() {
	if($(this).children('img').length>1){
			$(this).children('img:gt(0)').hide();
			var thisUp=$(this);
    		setInterval(function(){
      		thisUp.children(':first-child').fadeOut(2000)
         	.next('img').fadeIn(2000)
         	.end().appendTo(thisUp);}, 
     		 5000);
			}
};


 
})( jQuery );

$(document).ready(function() {	
	$.locAr=$.loc.split("X");
	$('.hide').hide();
	

						   });

