function Redirect(sSrc){
	window.location = sSrc;	
}

function OpenPopup(sURL, PositionX, PositionY, defaultWidth, defaultHeight){	
		
		var AutoClose = true;
		var isNN=(navigator.appName=="Netscape")?1:0;
		var isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;
		
		var optNN='scrollbars=yes,resizable=1,width='+defaultWidth+',height='+defaultHeight+',left='+PositionX+',top='+PositionY;
		var optIE='scrollbars=yes,resizable=1,width='+defaultWidth+',height='+defaultHeight+',left='+PositionX+',top='+PositionY;

		if (isNN) { imgWin = window.open(sURL + '&fromsite=1', '', optNN); }
		if (isIE) { imgWin = window.open(sURL + '&fromsite=1', '', optIE); }
		
		return imgWin;
}

function OpenExtrasPopup(sURL) {

  var PositionX = 100;
  var PositionY = 100;
  var defaultWidth = 510;
  var defaultHeight = 500;

  var AutoClose = true;
  var isNN = (navigator.appName == "Netscape") ? 1 : 0;
  var isIE = (navigator.appName.indexOf("Microsoft") != -1) ? 1 : 0;

  var optNN = 'scrollbars=yes,resizable=0,status=0,toolbar=0,location=0,menubar=0,width=' + defaultWidth + ',height=' + defaultHeight + ',left=' + PositionX + ',top=' + PositionY;
  var optIE = 'scrollbars=yes,resizable=0,status=0,toolbar=0,location=0,menubar=0,width=' + defaultWidth + ',height=' + defaultHeight + ',left=' + PositionX + ',top=' + PositionY;

  if (isNN) { imgWin = window.open(sURL, '', optNN); }
  if (isIE) { imgWin = window.open(sURL, '', optIE); }

  return imgWin;
}

    function OpenPicture(sURL){
	    var imgWin;
	    imgWin = OpenPopup(sURL, 10, 10, 800, 600);
	    return true;
    }

	function Files_OpenPopup(sURL){
		OpenPopup(sURL, 0, 0, 800, 600);
	}



function OnBasketItemAdded(iIndex)
{
	window.location = 'P23.asp';
}

function BasketItem_Add(iID)
{
	LoadRemoteDataCallBack('P22.AddBasketItem.asp?ID=' + iID, OnBasketItemAdded, null);
}

function RepositionElts() {
	//objMenu = document.getElementById('mainmenu');	
	//if(objFooter)
	{
		//iMainContentright = (GetDocumentWidth()-770);
		//iMainContentright = Math.round(iMainContentright / 2); 
		
		//objFooter.style.right = iMainContentright;
		//objFooter.style.bottom = 0;
	}
}

/*if(ie) setInterval('RepositionElts()', 1000);*/

function Open4WEBWindow() {
	var hWnd;
	hWnd = window.open('http://www.4web.si/')
	hWnd.focus();
}

var bMouseOverTopMenuButton = 0
var iUnmaskTopMenuButtonsTimerID = 0
function UnmaskTopMenuButtons()
{
	clearInterval(iUnmaskTopMenuButtonsTimerID);
	iUnmaskTopMenuButtonsTimerID = 0;
	if(bMouseOverTopMenuButton) return;
	
	objDivOff = document.getElementById('divTopMenuBtnMaskOff')
	objDivOn = document.getElementById('divTopMenuBtnMaskOn')
	for(var i=1; i <= 7; i+=1)
	{
		GetSubElementByID(objDivOff, i).style.visibility = 'hidden';
		GetSubElementByID(objDivOn, i).style.visibility = 'hidden';
	}
}

function TopMenuBtn(iBtn, bOn) {
	bMouseOverTopMenuButton = bOn;
	//Reset all buttons
	if(!bOn)
	{
		if(!iUnmaskTopMenuButtonsTimerID) iUnmaskTopMenuButtonsTimerID = setInterval('UnmaskTopMenuButtons()', 1);
		return;
	}
	//Display all off buttons
	objDivOff = document.getElementById('divTopMenuBtnMaskOff')
	objDivOn = document.getElementById('divTopMenuBtnMaskOn')
	for(var i=1; i <= 7; i+=1)
	{
		GetSubElementByID(objDivOff, i).style.visibility = 'visible';
		GetSubElementByID(objDivOn, i).style.visibility = 'hidden';
	}
	//Display on button
	GetSubElementByID(objDivOn, iBtn).style.visibility = 'visible';	
	
}

function changeImage(idE, image){
	newImage = "url(" + image + ")";
	document.getElementById('mid'+idE).style.backgroundImage=newImage;
}

function changeImageTop(id, image){
	newImage = "url(" + image + ")";
	document.getElementById(id).style.backgroundImage=newImage;
}

function RunGallery(){
	if ( window.GalleryDisplay )
		GalleryDisplay();
}


/*Main menu*/
//function MainMenu_ChangeClass(obj, class){
	//alert('aa');
	//if isObject(obj) alert(class);
//}
function MainMenu_ChangeClass(objMenu,className){
	if (isObject(objMenu)) objMenu.className = className;
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}



/* SEARCH */

	function CheckFrmSearch(txtObj, sLink){
	    
	    	
		oS = $(txtObj);
		var sS = oS.value;
		
		if ((sS == "") || (sS.indexOf("iskalni niz") > -1)) {			
			alert( "Niste vpisali iskalnega niza.");
			oS.focus();				
			return false;
		}	
		if(sS.length < 3){			
			alert("Iskalna beseda mora vsebovati vsaj 3 znake.");
			oS.focus();				
			return false;
		}	
		window.location = sLink + "key="+sS;
		return false;
	}
	
	function KeyPress_Search(evt, txtObj, sLink){
	//alert(evn);
	//txtObj = "searchS";
	//alert(txtObj);
	
	var evt = (evt) ? evt : ((event) ? event : null); 
	
	var node = (evt.target) ? evt.target : ((evt.srcElement) ? evt.srcElement : null);

	if ((evt.keyCode == 13) && (node.type=="text"))  {

	  return CheckFrmSearch(txtObj, sLink);
	} 
	
	return true;

	}


	function Field_SetValue(sFieldName, sValue, setFirstIfNotFound) {
	  field = $(sFieldName);

	  if (field) {

	    if (field.tagName == "SELECT") {

	      var opt = null;
	      var isFound = false;
	      for (i = 0; i < field.options.length; i++) {
	        opt = field.options[i];
	        if (opt.value == sValue) {
	          opt.selected = true;
	          isFound = true;
	        } else {
	          opt.selected = false;
	        }
	      }
	      if ((!isFound) & (setFirstIfNotFound)) {
	        if (field.options.length >= 1) {
	          field.options[0].selected = true;
	        }
	      }

	    } else if (field.tagName == "INPUT") {

	      if (field.type == "text") {
	        field.value = sValue;
	      } else if (field.type == "checkbox") {
	        field.checked = sValue;
	      }

	    }

	  }
	}

	function formatCurrency(num) {

	  num = num.toString().replace(/\$|\,/g, '');

	  if (isNaN(num))
	    num = "0";
	  sign = (num == (num = Math.abs(num)));
	  num = Math.floor(num * 100 + 0.50000000001);
	  cents = num % 100;
	  num = Math.floor(num / 100).toString();

	  if (cents < 10)
	    cents = "0" + cents;

	  for (var i = 0; i < Math.floor((num.length - (1 + i)) / 3); i++)
	    num = num.substring(0, num.length - (4 * i + 3)) + '.' + num.substring(num.length - (4 * i + 3));

	  return num + ',' + cents;
	}

	function trim(str, chars) {
	  return ltrim(rtrim(str, chars), chars);
	}

	function ltrim(str, chars) {
	  chars = chars || "\\s";
	  return str.replace(new RegExp("^[" + chars + "]+", "g"), "");
	}

	function rtrim(str, chars) {
	  chars = chars || "\\s";
	  return str.replace(new RegExp("[" + chars + "]+$", "g"), "");
	}

	function f_scrollTop() {
	  return f_filterResults(
		window.pageYOffset ? window.pageYOffset : 0,
		document.documentElement ? document.documentElement.scrollTop : 0,
		document.body ? document.body.scrollTop : 0
	);
	}

	function f_filterResults(n_win, n_docel, n_body) {
	  var n_result = n_win ? n_win : 0;
	  if (n_docel && (!n_result || (n_result > n_docel)))
	    n_result = n_docel;
	  return n_body && (!n_result || (n_result > n_body)) ? n_body : n_result;
	}

	function isValidEmailAddress(emailAddress) {
	  var pattern = new RegExp(/^(("[\w-\s]+")|([\w-]+(?:\.[\w-]+)*)|("[\w-\s]+")([\w-]+(?:\.[\w-]+)*))(@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$)|(@\[?((25[0-5]\.|2[0-4][0-9]\.|1[0-9]{2}\.|[0-9]{1,2}\.))((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\.){2}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\]?$)/i);
	  return pattern.test(emailAddress);
	}




	function runBanners(noOfBanners, iUniqueID, currID, divIdPrefix, bannerTimer) {

	  var currBanner = parseInt(jQuery('#' + currID).val());
	  var nextBanner = currBanner + 1;

	  if (nextBanner >= noOfBanners) { nextBanner = 0 };

	  for (i = 0; i < noOfBanners; i++) {

	    var bannerDiv = jQuery('#' + divIdPrefix + iUniqueID + '_' + (i + 1));

	    if (i == currBanner) { bannerDiv.show(); } else { bannerDiv.hide(); }
	  }

	  jQuery('#' + currID).val(nextBanner);

	  setTimeout(function() { runBanners(noOfBanners, iUniqueID, currID, divIdPrefix, bannerTimer) }, bannerTimer);


}



function initializeGMap() { /*do nothing - foo function*/ }
function refreshYouTube() { /*do nothing - foo function*/ }


function MoveLeft(GalleryID) {

    var noOfSlides = parseInt(jQuery('#' + GalleryID + '_noOfSlides').attr('class'));
    var currSlide = parseInt(jQuery('#' + GalleryID + '_currSlide').attr('class'));

    var prevSlide = currSlide - 1;

    jQuery('#' + GalleryID + '_arrowRight').removeClass('SliderArrowRight_Disabled');
    jQuery('#' + GalleryID + '_arrowRight').addClass('SliderArrowRight');

    if ((prevSlide - 1) <= 0) {
        var direction = 'Left';
        var arrowID = '#' + GalleryID + '_arrow' + direction;
        jQuery(arrowID).removeClass('SliderArrow' + direction);
        jQuery(arrowID).removeClass('SliderArrow' + direction + '_Click');
        jQuery(arrowID).removeClass('SliderArrow' + direction + '_Over');
        jQuery(arrowID).addClass('SliderArrow' + direction + '_Disabled');
    }

    if (prevSlide <= 0) {
        //prevSlide = noOfSlides 
    } else {

        jQuery('#' + GalleryID + '_slideCnt').html(prevSlide + ' / ' + noOfSlides);

        /*jQuery('#' + GalleryID + '_SlideTitle_' + currSlide).fadeOut(400);
        jQuery('#' + GalleryID + '_SlideDesc_' + currSlide).fadeOut(400);
        jQuery('#' + GalleryID + '_Slide_' + currSlide).delay(300).fadeOut(400);
        jQuery('#' + GalleryID + '_Slide_' + prevSlide).delay(500).fadeIn(400);
        jQuery('#' + GalleryID + '_SlideTitle_' + prevSlide).hide();
        jQuery('#' + GalleryID + '_SlideDesc_' + prevSlide).hide();
        jQuery('#' + GalleryID + '_SlideTitle_' + prevSlide).delay(600).fadeIn(1000);
        jQuery('#' + GalleryID + '_SlideDesc_' + prevSlide).delay(600).fadeIn(1000);*/


        jQuery('#' + GalleryID + '_SlideDesc_' + currSlide).hide();


        //jQuery('#' + GalleryID + '_Slide_' + currSlide).hide();
        //jQuery('#' + GalleryID + '_Slide_' + prevSlide).show();


        jQuery('#' + GalleryID + '_Slide_' + prevSlide).css("left", "-767px");
        jQuery('#' + GalleryID + '_Slide_' + prevSlide).show();

        jQuery('#' + GalleryID + '_Slide_' + prevSlide).stop().animate({ "left": "0px" }, 800);
        jQuery('#' + GalleryID + '_Slide_' + currSlide).stop().animate({ "left": "767px" }, 800);
        //jQuery('#' + GalleryID + '_Slide_' + currSlide).delay(800).fadeOut();



        //	    jQuery('#' + GalleryID + '_Slide_' + currSlide).animate({ "left": "-767px" }, 800);


        jQuery('#' + GalleryID + '_SlideDesc_' + prevSlide).hide();
        jQuery('#' + GalleryID + '_SlideDesc_' + prevSlide).show();
        jQuery('#' + GalleryID + '_currSlide').removeAttr('class');
        jQuery('#' + GalleryID + '_currSlide').attr('class', prevSlide);
    }
}


function MoveRight(GalleryID) {

    var noOfSlides = parseInt(jQuery('#' + GalleryID + '_noOfSlides').attr('class'));
    var currSlide = parseInt(jQuery('#' + GalleryID + '_currSlide').attr('class'));

    jQuery('#' + GalleryID + '_arrowLeft').removeClass('SliderArrowLeft_Disabled');
    jQuery('#' + GalleryID + '_arrowLeft').addClass('SliderArrowLeft');


    var nextSlide = currSlide + 1;

    if ((nextSlide + 1) > noOfSlides) {
        var direction = 'Right';
        var arrowID = '#' + GalleryID + '_arrow' + direction;
        jQuery(arrowID).removeClass('SliderArrow' + direction);
        jQuery(arrowID).removeClass('SliderArrow' + direction + '_Click');
        jQuery(arrowID).removeClass('SliderArrow' + direction + '_Over');
        jQuery(arrowID).addClass('SliderArrow' + direction + '_Disabled');
    }


    if (nextSlide > noOfSlides) {
        // nextSlide = 1


    }
    else {

        jQuery('#' + GalleryID + '_slideCnt').html(nextSlide + ' / ' + noOfSlides);

        /*jQuery('#' + GalleryID + '_SlideTitle_' + currSlide).fadeOut(400);
        jQuery('#' + GalleryID + '_SlideDesc_' + currSlide).fadeOut(400);
        jQuery('#' + GalleryID + '_Slide_' + currSlide).delay(300).fadeOut(400);
        jQuery('#' + GalleryID + '_Slide_' + nextSlide).delay(500).fadeIn(400);
        jQuery('#' + GalleryID + '_SlideTitle_' + nextSlide).hide();
        jQuery('#' + GalleryID + '_SlideDesc_' + nextSlide).hide();
        jQuery('#' + GalleryID + '_SlideTitle_' + nextSlide).delay(600).fadeIn(1000);
        jQuery('#' + GalleryID + '_SlideDesc_' + nextSlide).delay(600).fadeIn(1000);*/

        jQuery('#' + GalleryID + '_SlideDesc_' + currSlide).hide()
        //jQuery('#' + GalleryID + '_Slide_' + currSlide).hide();
        //jQuery('#' + GalleryID + '_Slide_' + nextSlide).show();


        jQuery('#' + GalleryID + '_Slide_' + nextSlide).css("left", "767px");
        jQuery('#' + GalleryID + '_Slide_' + nextSlide).show();

        jQuery('#' + GalleryID + '_Slide_' + currSlide).stop().animate({ "left": "-767px" }, 800);
        jQuery('#' + GalleryID + '_Slide_' + nextSlide).stop().animate({ "left": "0px" }, 800);
        //jQuery('#' + GalleryID + '_Slide_' + currSlide).delay(800).fadeOut();


        jQuery('#' + GalleryID + '_SlideDesc_' + nextSlide).hide();
        jQuery('#' + GalleryID + '_SlideDesc_' + nextSlide).show();

        jQuery('#' + GalleryID + '_currSlide').removeAttr('class');
        jQuery('#' + GalleryID + '_currSlide').attr('class', nextSlide);
    }
}


function Arrows(direction, GalleryID) {

    jQuery('#' + GalleryID + '_arrow' + direction).mouseover(function() {

        jQuery(this).removeClass('SliderArrow' + direction);
        jQuery(this).removeClass('SliderArrow' + direction + '_Click');
        jQuery(this).addClass('SliderArrow' + direction + '_Over');

    });

    jQuery('#' + GalleryID + '_arrow' + direction).mouseout(function() {

        jQuery(this).addClass('SliderArrow' + direction);
        jQuery(this).removeClass('SliderArrow' + direction + '_Click');
        jQuery(this).removeClass('SliderArrow' + direction + '_Over');



    });

    jQuery('#' + GalleryID + '_arrow' + direction).mousedown(function() {

        jQuery(this).removeClass('SliderArrow' + direction);
        jQuery(this).addClass('SliderArrow' + direction + '_Click');
        jQuery(this).removeClass('SliderArrow' + direction + '_Over');


    });

    jQuery('#' + GalleryID + '_arrow' + direction).mouseup(function() {

        jQuery(this).removeClass('SliderArrow' + direction);
        jQuery(this).removeClass('SliderArrow' + direction + '_Click');
        jQuery(this).addClass('SliderArrow' + direction + '_Over');

    });

    jQuery('#' + GalleryID + '_arrow' + direction).click(function() {

        if (direction == 'Left') {
            MoveLeft(GalleryID);
        }
        else {
            MoveRight(GalleryID);
        }


    });


}


function overlayMouseOver(event) {

    var obj = "#sliderOverlay";

    var overlayH = 82;
    var containerHeight = 345;
    var fromTop = containerHeight - overlayH

    jQuery(obj).css("height", overlayH + "px");
    jQuery(obj).stop().animate({ "top": fromTop + "px" }, 200);
    event.stopPropagation();

}

function overlayMouseOut(event) {

    var obj = "#sliderOverlay";

    var overlayH = 35;
    var containerHeight = 345;
    var fromTop = containerHeight - overlayH

    jQuery(obj).stop().animate({ "top": fromTop + "px" }, 200);
    event.stopPropagation();
}


function initSlider(GalleryID) {

    Arrows('Left', GalleryID);
    Arrows('Right', GalleryID);
}









function initLinkCollection() {

    jQuery('.ui_button').each(function() {

        var iID = jQuery(this).attr('id');

        if (iID.indexOf('_arrowLeft') > -1) {
            iID = iID.replace('_arrowLeft', '');
            LinkCollectionArrows('Left', iID, 'ui');
        } else {
            iID = iID.replace('_arrowRight', '');
            LinkCollectionArrows('Right', iID, 'ui');

        }





    });

    jQuery('.SliderArrow2').each(function() {

        var iID = jQuery(this).attr('id');

        if (iID.indexOf('_arrowLeft') > -1) {
            iID = iID.replace('_arrowLeft', '');
            LinkCollectionArrows('Left', iID, 'slider');
        } else {
            iID = iID.replace('_arrowRight', '');
            LinkCollectionArrows('Right', iID, 'slider');

        }





    });

}






function MoveLinkCollectionLeft(GalleryID, type) {

    var noOfSlides = parseInt(jQuery('#' + GalleryID + '_noOfSlides').attr('class'));
    var currSlide = parseInt(jQuery('#' + GalleryID + '_currSlide').attr('class'));

    var prevSlide = currSlide - 1;

    if (type == 'ui') {

        jQuery('#' + GalleryID + '_arrowRight').removeClass('ui_buttonRight_Disabled');
        jQuery('#' + GalleryID + '_arrowRight').addClass('ui_buttonRight');

        if ((prevSlide - 1) <= 0) {
            var direction = 'Left';
            var arrowID = '#' + GalleryID + '_arrow' + direction;
            jQuery(arrowID).removeClass('ui_button' + direction);
            jQuery(arrowID).removeClass('ui_button' + direction + '_Over');
            jQuery(arrowID).addClass('ui_button' + direction + '_Disabled');
        }
    } else {

        jQuery('#' + GalleryID + '_arrowRight').removeClass('SliderArrowRight_Disabled');
        jQuery('#' + GalleryID + '_arrowRight').addClass('SliderArrowRight');

        if ((prevSlide - 1) <= 0) {
            var direction = 'Left';
            var arrowID = '#' + GalleryID + '_arrow' + direction;
            jQuery(arrowID).removeClass('SliderArrow' + direction);
            jQuery(arrowID).removeClass('SliderArrow' + direction + '_Over');
            jQuery(arrowID).addClass('SliderArrow' + direction + '_Disabled');
        }

    }
    if (prevSlide <= 0) { }
    else {

        jQuery('#' + GalleryID + '_slideCnt').html(prevSlide + ' / ' + noOfSlides);

        jQuery('#' + GalleryID + '_Slide_' + currSlide).hide();
        jQuery('#' + GalleryID + '_Slide_' + prevSlide).show();

        jQuery('#' + GalleryID + '_currSlide').removeAttr('class');
        jQuery('#' + GalleryID + '_currSlide').attr('class', prevSlide);
    }
}


function MoveLinkCollectionRight(GalleryID, type) {

    var noOfSlides = parseInt(jQuery('#' + GalleryID + '_noOfSlides').attr('class'));
    var currSlide = parseInt(jQuery('#' + GalleryID + '_currSlide').attr('class'));

    var nextSlide = currSlide + 1;


    if (type == 'ui') {

        jQuery('#' + GalleryID + '_arrowLeft').removeClass('ui_buttonLeft_Disabled');
        jQuery('#' + GalleryID + '_arrowLeft').addClass('ui_buttonLeft');


        if ((nextSlide + 1) > noOfSlides) {
            var direction = 'Right';
            var arrowID = '#' + GalleryID + '_arrow' + direction;
            jQuery(arrowID).removeClass('ui_button' + direction);
            jQuery(arrowID).removeClass('ui_button' + direction + '_Over');
            jQuery(arrowID).addClass('ui_button' + direction + '_Disabled');
        }
    } else {

        jQuery('#' + GalleryID + '_arrowLeft').removeClass('SliderArrowLeft_Disabled');
        jQuery('#' + GalleryID + '_arrowLeft').addClass('SliderArrowLeft');

        if ((nextSlide + 1) > noOfSlides) {
            var direction = 'Right';
            var arrowID = '#' + GalleryID + '_arrow' + direction;
            jQuery(arrowID).removeClass('SliderArrow' + direction);
            jQuery(arrowID).removeClass('SliderArrow' + direction + '_Over');
            jQuery(arrowID).addClass('SliderArrow' + direction + '_Disabled');
        }



    }




    if (nextSlide > noOfSlides) { }
    else {

        jQuery('#' + GalleryID + '_slideCnt').html(nextSlide + ' / ' + noOfSlides);
        jQuery('#' + GalleryID + '_Slide_' + currSlide).hide();
        jQuery('#' + GalleryID + '_Slide_' + nextSlide).show();
        jQuery('#' + GalleryID + '_currSlide').removeAttr('class');
        jQuery('#' + GalleryID + '_currSlide').attr('class', nextSlide);
    }
}

function LinkCollectionArrows(direction, GalleryID, type) {

    if (type == 'ui') {

        jQuery('#' + GalleryID + '_arrow' + direction).mouseover(function() {

            jQuery(this).removeClass('ui_button' + direction);
            jQuery(this).addClass('ui_button' + direction + '_Over');

        });

        jQuery('#' + GalleryID + '_arrow' + direction).mouseout(function() {

            jQuery(this).addClass('ui_button' + direction);
            jQuery(this).removeClass('ui_button' + direction + '_Over');

        });

    }
    else {

        jQuery('#' + GalleryID + '_arrow' + direction).mouseover(function() {

            jQuery(this).removeClass('SliderArrow' + direction);
            jQuery(this).removeClass('SliderArrow' + direction + '_Click');
            jQuery(this).addClass('SliderArrow' + direction + '_Over');

        });

        jQuery('#' + GalleryID + '_arrow' + direction).mouseout(function() {

            jQuery(this).addClass('SliderArrow' + direction);
            jQuery(this).removeClass('SliderArrow' + direction + '_Click');
            jQuery(this).removeClass('SliderArrow' + direction + '_Over');



        });

    }




    if (direction == 'Left') {

        jQuery('#' + GalleryID + '_arrowLeft').click(function() { MoveLinkCollectionLeft(GalleryID, type); });
    } else {
        jQuery('#' + GalleryID + '_arrowRight').click(function() { MoveLinkCollectionRight(GalleryID, type); });
    }




}
