 

    $(document).ready(function() {

    
    /* BANNER -------------------------------------------------------------------------------------------- */
      $(".paging").show(); $(".paging a:first").addClass("switch");
      var imageWidth = $(".window").width(); var imageSum = $(".image_reel img").size(); var imageReelWidth = imageWidth * imageSum;
      $(".image_reel").css({'width' : imageReelWidth});
      var num_arr = Array(0,6,5,4,3,2,1,0,-1,-2,-3); var fld_arr = Array('','','','2','','1|3','1|3|4|6','','','1|2|4|5|6|8|9','1|10');
      $(".paging a").attr("id", function (arr) { return arr;}).each(function(){
        var idnum = parseInt(this.id)+1; var ext_fld = fld_arr[imageSum].split("|");
        if (fld_arr[imageSum]!='') {
          $(".paging a[rel="+idnum+"]").css({'width' : Math.floor(((imageWidth+num_arr[imageSum])/imageSum)) });
          for (var f=0; f<ext_fld.length; f++)
            if (ext_fld[f]==idnum) $(".paging a[rel="+idnum+"]").css({'width' : Math.floor(((imageWidth+num_arr[imageSum])/imageSum)+1) });
        } else
          $(".paging a[rel="+idnum+"]").css({'width' : Math.floor(((imageWidth+num_arr[imageSum])/imageSum)) });
      });
      rotate = function(){  
        var triggerID = $active.attr("rel") - 1; var image_reelPosition = triggerID * imageWidth;
        $(".paging a").removeClass('switch');
        $active.addClass('switch');
        $(".image_reel").animate({ 
            left: -image_reelPosition
        }, 500 );
      }; 
      rotateSwitch = function(){        
        play = setInterval(function(){
            $active = $('.paging a.switch').next();
            if ($active.length === 0) { $active = $('.paging a:first'); }
            rotate();
        }, 7000);
      };
      rotateSwitch();
      $(".image_reel a").hover(function() {
        clearInterval(play);
      }, function() {
        rotateSwitch();
      });   
      $(".paging a").click(function() { 
        $active = $(this); clearInterval(play); rotate();
        return false;
      });
	  }); 
	  
	  global.showMore = function showMore(articleId, show) {
		if(show=='show') {
			var display = 'display:block'; 
			var show = 'hide'; }
		else {
			var display = 'display:none';
			var show = 'show'; }
		var link = '';
		if (global.doc.getElementById('link_'+articleId)=='undefined') {
			var links = global.getElementsByTagName("a");
			for (var i=0; i<links.length; i++) {
				if(links[i].getAttribute("href")=='#'+articleId) {
					link = links[i];
				}
			}
		} else {
			link = global.doc.getElementById('link_'+articleId);
		}
		global.doc.getElementById(articleId).setAttribute('style', display);
		global.doc.getElementById('link_'+articleId).setAttribute('href',"javascript:global.showMore('"+articleId+"','"+show+"')") ;         
	}

	// recieves values of a form, runs through all values, looks for whether they are set
	// if not a message will returned, the form will be submitted otherwise while
	// all obligatory values are set. accordant functions are parseInserts(), 
	// setErrorMessages(), missingValuesMessages() and deletingErrorMessage()
