$(document).ready(function(){   
	// preload image
	try {
		loaderBar = new Image();
		loaderBar.src = "/images/loadingAnimation.gif";
	}
	catch (e) {}
	
	//$('a.galleryLightbox').css({'display' : 'none', 'visibility' : 'visible'}).fadeIn("fast");
	
	//if e.g. a gallery should be loaded which does not exist
	$(document).ajaxError(function(event, request, settings){
	    removeGalleryLightboxOnError();
	});
});
		
	
//function called when user clicks on a galleryLightbox link
function showGalleryLightbox(url) { 
	//only show the box if it doesn't already exist one
	if (!($("#galleryLightbox").length))
	{	
		//show overlay and add loader to the page
		if (!($("#galleryLightboxOverlay").length))
		{
			$("body").append("<div id='galleryLightboxOverlay'></div><div id='galleryLightboxLoader'><img src='"+loaderBar.src+"' /></div>");
		}
		
		$("#galleryLightboxOverlay, #galleryLightboxLoader").fadeIn(500, function() {
		    //hide all advert-containers on whole page
		    if (typeof OAS_listpos != "undefined")
		    {
			    adPositions = OAS_listpos.split(","); //get positions from referer page
			    for (var i = 0; i < adPositions.length; i++)
			    {
			        $("#AdContainer_" + adPositions[i]).fadeTo("slow", 0.1, function() {
			            $(this).css({'visibility' : 'hidden'});
			        });
			    }
		    }
			$("#Ad_Win2day").fadeTo("slow", 0.1, function() {
				$(this).css({'visibility' : 'hidden'});
			});
					
		    //hide all flash ads
		    $('embed, iframe').each(function() {
    		    $(this).fadeTo("slow", 0.1, function() {
    		        $(this).css({'visibility' : 'hidden'});
    		    });
            });
		 
            //prepare z-indizes of navigation
    		$('#PortalMainNavigation').css({'z-index' : '1'});
		});
		
		
		
		
		var ie6 = $.browser.msie && /MSIE 6.0/.test(navigator.userAgent);
		
		if (ie6)
		{
			var galleryLightboxOverlay = $('#galleryLightboxOverlay');
			galleryLightboxOverlay.css('position','absolute');
			//debugger

			$.each([galleryLightboxOverlay[0]], function(i,o) { 
				//alert("i" + i + ", o" + o)
				var s = o.style;
				s.position = 'absolute';
				s.setExpression('height','Math.max(document.body.scrollHeight, document.body.offsetHeight) + "px"');
			});
			
		}
		
		//try to load and create a gallery (catch errors like "access to restricted uri denied (code: 1012)" and so on)
		try {
		    //fetch gallery via ajax call
		    $.ajax({
			    url: url,
			    cache: true,
			    async: true,
			    success: function(html){
				    $("#galleryLightbox").remove();
				    $("body").append('<div id="galleryLightbox"></div>');

				    $("#galleryLightbox").append(html);
    				
    				
				    if (ie6)
				    {
					    var galleryLightbox = $('#galleryLightbox');
					    var galleryLightboxLoader = $('#galleryLightboxLoader');
					    $.each([galleryLightbox[0], galleryLightboxLoader[0]], function(i,o) { 
						    //alert("i" + i + ", o" + o)
						    //debugger
						    var s = o.style;
						    s.position = 'absolute';
						    s.setExpression('top','(document.documentElement.clientHeight || document.body.clientHeight) / 2 - (this.offsetHeight / 2) + (bla = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"');
					    });
				    }
    				
    				
				    $("#galleryLightbox").fadeIn("slow");
    				
					$(".close").click(removeGalleryLightbox);
    			     
				    //create gallery
				    $("#gallery-wrapper").ready(function(){
					    $("#gallery-wrapper").gallery({
						    useKeyboardShortcuts: false
					    });
    				
					    $("#galleryLightboxLoader").fadeOut("fast");
				    });
			    }
		    });

    	  
		    $("#galleryLightboxOverlay").click(removeGalleryLightbox);
    	    
		    document.onkeydown = function(e){   
			    if (e == null) { // ie
				    keycode = event.keyCode;
			    } 
			    else { // mozilla
				    keycode = e.which;
			    }
    			
			    if(keycode == 27){ // close
				    removeGalleryLightbox();
		        }  
		    };
		}
		catch (e)
		{
		    removeGalleryLightboxOnError();
		    //console.log("error loading following url: " + url + "; (" + location.href + ")");
		}
		
		return false;
	}
}

function removeGalleryLightbox() {
	$("#galleryLightboxOverlay").unbind("click");
	$("#galleryLightbox").fadeOut("slow",function(){
	    $('#galleryLightbox, #galleryLightboxOverlay, #galleryLightboxLoader').trigger("unload").unbind().remove();
	
	    //display all advert-containers on whole page
	    if (typeof OAS_listpos != "undefined")
	    {
		    adPositions = OAS_listpos.split(","); //get positions from referer page
		    for (var i = 0; i < adPositions.length; i++)
		    {
		        $("#AdContainer_" + adPositions[i]).css({'visibility' : 'visible'}).fadeTo("slow", 1);
		    }
	    }
		$("#Ad_Win2day").css({'visibility' : 'visible'}).fadeTo("slow", 1);
			
	    //display all flash ads
	    $('embed, iframe').each(function() {
		    $(this).css({'visibility' : 'visible'}).fadeTo("slow", 1);
        });
        
        //prepare z-indizes of navigation
        $('#PortalMainNavigation').css({'z-index' : '10001'});
    });
	
	document.onkeydown = "";
	
	return false;
}

function removeGalleryLightboxOnError() {
    $('#galleryLightboxOverlay, #galleryLightboxLoader').trigger("unload").unbind().remove();
    return false;
}
(function($) {
    $.fn.gallery = function(options) {
    	var defaults = {
    			imageIndex: 0,
                pageIndex: 0,
                useKeyboardShortcuts: false,
	            displayImageNavigationArrows: true,
	            displayThumbnailsNavigationArrows: true,
	            numberOfThumbnails: 4,
	            imageFadeInSpeed: 400,
	            thumbsFadeInSpeed: 600,
	            thumbsFadeInInterval: 75,
	            thumbsFadeOutSpeed: 400,
	            imageWidth: 590,
	            imageHeight: 390,
	            imageResizerUrl: "http://thumbs.tele.net/?maxh=390&maxw=590&url=",
	            useCodes: true,
                    useGA: useGAz,
	            useWT: useWTz,
	            useBRAT: useBRATz,
                    useTrafic: useTraficz,
                    useWA: useWAz,
                    useGemius: useGemiusz
        };		

        var opts = $.extend(defaults, options);
       
        //gallery name or id
        var galleryName = $('#gallery-wrapper').attr("name");
        
        //array index of currently displayed image on which page
        var currentImage = parseInt(opts.imageIndex);
        var currentPage = parseInt(opts.pageIndex);
       
		//debugger
	   
        //calculate total number of images and pages
        var totalImages = parseInt($('.gallery-more ul').children().length);
        var totalPages = parseInt((totalImages-1)/opts.numberOfThumbnails);
        

       
        return this.each(function(){
            $this = $(this);
           
            var o = $.meta ? $.extend({}, opts, $this.data()) : opts;

            images = [];
            imageObjects = [];
            $('.gallery-pagination .total-pos').html(totalImages);
           
            //append class "t#" to each thumbnail and put them all into an array
            thumblinks = $(".gallery-more ul li a");   
            for (var x = 0; x < thumblinks.length; x++) {
                thumblink = thumblinks.eq(x);
                thumblink.addClass("t" + x);
         
                images.push({
                    url:thumblink.attr("href"),
                    title:unescape(thumblink.children("img").attr("alt")),
                    imageHeight:parseInt(thumblink.attr("height")),
                    imageWidth:parseInt(thumblink.attr("width"))
                });
            }
           
            
            //initialize oCodes if the settings want it
            if (o.useCodes) 
            {
	            $('#gallery-wrapper').append("<div id='oCodes' style='display:none;'><div id='Cbrat'></div><div id='Cgemius'></div><div id='CwA'></div></div>");
            }
            
            
            //display first image and first thumbnail page
            showImage(images[0]);
            
            if (o.numberOfThumbnails > 0)
            	showThumbnails(0);
            
            if (o.displayImageNavigationArrows)
            	updateImageNav();
            else
            	$('a.prev, a.next').hide();
            	
            if (o.displayThumbnailsNavigationArrows && totalPages > 0)
            	updateThumbsNav(0);           
            else
            	$('a.more-prev, a.more-next').hide();
            
           
           
            //EVENTHANDLER
            $('.gallery-more ul li a', this).click(function() {
                //debugger
            	$(this).removeClass('active');
                var thumbClass = $(this).attr("class");
                var thumbId = parseInt(thumbClass.slice(1, thumbClass.length));
                currentImage = thumbId;
                $(this).addClass('active');
               
                showImage(images[currentImage]);

                updateImageNav();
               
                return false;
            });
            

            

            
           
            $('.gallery-hover-nav span', this).click(function() {
                //debugger
            	$('.gallery-more ul li a').removeClass('active');
               
                // get image id to display
                var thumbId = parseInt($(this).attr("rel"));
               
                // select an appropriate thumbnail
                $('.gallery-more ul li a.t' + thumbId).addClass('active');
           
                currentImage = thumbId;
               
                showImage(images[currentImage]);

                updateImageNav();
               
                //calculate on which page the currently displayed image is located on
                //imgOnPage = parseInt(Math.round((o.numberOfThumbnails/totalImages) * (currentImage + 1)));
                imgOnPage = parseInt(currentImage / o.numberOfThumbnails);
                
                if (currentPage != imgOnPage)
                {
                    showThumbnails(imgOnPage);
                    updateThumbsNav(imgOnPage);
                }
               
                return false;
            });
           
           
            $('.gallery-more-paging a', this).click(function() {
            	var page = $(this).attr("rel");
            	
	 	  $(this).hide(); //dani

                showThumbnails(page);
                updateThumbsNav(page); 
	        
		 $showItem = $(this);setTimeout( function() {$showItem.show() }, 1000); //dani

                
                return false;
            });
			
			
			//hover navigation
			$('.gallery-hover-nav a.prev', this).click(function() {
                //prev image
				$('.gallery-hover-nav span.prev').click();
				
                return false;
            });
			$('.gallery-hover-nav a.next', this).click(function() {
				//nextimage
				$('.gallery-hover-nav span.next').click();
                
				return false;
            });
           
       
           
            //COMMON FUNCTIONS
            function showImage(img) {
            	$("#galleryLightboxLoader").show();
            	var img_alt = img.title;
                var img_url = img.url;
                
                
                //$('.gallery-title').fadeOut("fast", function() {
            	//	$('.gallery-title').html(img_alt); //assign image heading title
            	//});
            	
            	$('.gallery-title').css({'color' : '#ffffff'});
            	$('.gallery-title').html(img_alt); //assign image heading title
            	
            	//$('#gallery-image img').hide();
                $('#gallery-image img').fadeOut("fast");
            	//$('#gallery-image img').attr("alt", img_alt);  	  //assign image alt
            
            	
            	//img_url is only in IE an absolute path
            	if (img_url.indexOf("http://") > -1)
                {
                  img_url = img_url.replace(/http:\/\//,"");
                  img_url = img_url.substring(img_url.indexOf("/"),img_url.length);
                }

				//use thumbnail gen if dimensions are not correct
            	if (img.imageWidth > o.imageWidth || img.imageHeight > o.imageHeight)
            	{
            		//replace city parameter in url with 'meinegemeinde' to reduce the number of entries in thumbnail gen configuration file 
            		var portal_domain = new String(location.host);
                    domain = portal_domain.match(/(.*)?(.vol.at)/);
                    //document.write("domain1->subdomain: " + domain[1] + "<br />");
                    //document.write("domain2->domain: " + domain[2] + "<br />");
                    //index 1 includes subdomain of location.host
                    if (typeof domain != "undefined" && domain != null)
                    {
                        if (domain[1] != "www" && domain[1] != "redesign" && domain[1] != "meinegemeinde")
                        {
                            portal_domain = "meinegemeinde" + domain[2];
                        }
                    }
            		
            		//concatenate urls					
            		img_url = o.imageResizerUrl + "http://" + portal_domain + urlencode(img_url);
            	}
            
            	
            	//http://jqueryfordesigners.com/image-loading/
            	var img = new Image();
            	$(img)
        	    	// once the image has loaded, execute this code
        	    	.load(function () {
        	    		//set the image hidden by default    
        	    		$(this).hide();
        	    		
        	    		//replace existing img element
        	    		$('#gallery-image img').after(this).remove(); 

        	    		
        	    		$(this).fadeIn(o.imageFadeInSpeed);
        	    		$("#galleryLightboxLoader").fadeOut("fast");
        	    		
        	    		if (img_alt.length > 0 || typeof img_alt == "undefined")
                		{
                			//$('.gallery-title').fadeIn(o.imageFadeInSpeed);
                			$('.gallery-title').css({'color' : '#666666'});
                		}
        	    		
        	    		
        	    		//there are some conflicts with the escape and hide functionality of the lightbox when these lines are uncommented
        	    		//bind click eventhandler to img 
        	    		//$('#gallery-image img').click(function () { 
        	            //	$('.gallery-paging a.next').click();
        	            //});
        	    		
        	    		
        	    		//preload next image 
                        if (currentImage < totalImages - 1)
                        {
                        	tmp_preImg = new Image();
                        	tmp_preImg.src = images[currentImage + 1].url;
                        }
        	    	})
        	    
        	    	// if there was an error loading the image, react accordingly
        	    	.error(function () {
        	    		// notify the user that the image could not be loaded
        	    		//alert("Could not load image!")
        	    	})
        	    // *finally*, set the src attribute of the new image to our image
        	    .attr('src', img_url);
            	
            	//do the statistic
            	updateStatistics();
            	updateAds();
            };
            
            
            function showThumbnails(thumbsPage) {
                //PROCESSING THUMBNAILS
                //create a reference to all the active thumbs (class .activeThumb)
                thumbsActive = $('.gallery-more .activeThumb, .gallery-more-paging');
                if (thumbsActive.length > 0)
                {
                    thumbsActive.fadeOut(o.thumbsFadeOutSpeed, function() {
                        setTimeout(function() {
                            //create a reference to all the thumbnails (li)
                            thumbs = $('.gallery-more ul li');
                            for (var j = 0; j < o.numberOfThumbnails; j++)
                            {
                                elem = (thumbsPage * o.numberOfThumbnails) + j;
                               
                                thumbs.eq(elem).addClass("activeThumb");
                                setTimeout('thumbs.eq(' + elem + ').fadeIn(' + o.thumbsFadeInSpeed + ')',o.thumbsFadeInInterval * j);
                            }                           
                        }, 300);
                    });
                }
                else
                {
                    setTimeout(function() {
                        //create a reference to all the thumbnails (li)
                        thumbs = $('.gallery-more ul li');
                        for (var j = 0; j < o.numberOfThumbnails; j++)
                        {
                            elem = (thumbsPage * o.numberOfThumbnails) + j;
                           
                            thumbs.eq(elem).addClass("activeThumb");
                            setTimeout('thumbs.eq(' + elem + ').fadeIn(' + o.thumbsFadeInSpeed + ')',o.thumbsFadeInInterval * j);
                        }
                    }, 300);
                }
                
                if (o.displayThumbnailsNavigationArrows)
                {
                	$('.gallery-more-paging').fadeIn(' + o.thumbsFadeInSpeed + ');
                }
                else
                {
                	$('.gallery-more-paging').hide();
                }
            };
            
            
            
       
            function updateImageNav() {
                //update the current position before doing anything
                $('.gallery-pagination .current-pos').html(currentImage + 1);

                var prev_image_thumb = currentImage;
                if (currentImage <= 0) {
                    prev_image_thumb = totalImages - 1;
                } else {
                    prev_image_thumb = currentImage - 1;
                }
               
                var next_image_thumb = currentImage;
                if (currentImage >= totalImages - 1) {
                    next_image_thumb = 0;
                } else {
                    next_image_thumb = currentImage + 1;   
                }
               
               
                $('.gallery-hover-nav span.prev').attr("rel", prev_image_thumb);
                $('.gallery-hover-nav span.next').attr("rel", next_image_thumb);
            };
           
           
            //analog to updateImageNav, now for thumbnails
            function updateThumbsNav(thumbsPage) {
            	thumbsPage = parseInt(thumbsPage);
                
                currentPage = thumbsPage;
            	
                pagePrev = thumbsPage - 1;
                pageNext = thumbsPage + 1;
               
                if (pagePrev < 0) {
                    pagePrev = totalPages;
                }
               
                if (pageNext > totalPages) {
                    pageNext = 0;
                }
               
                
                $('.gallery-more-paging a.more-prev').attr("rel", pagePrev);
                $('.gallery-more-paging a.more-next').attr("rel", pageNext);
            };
           
       
            function urlencode(str) {
            	return escape(str).replace(/\+/g,'%2B').replace(/%20/g, '+').replace(/\*/g, '%2A').replace(/\//g, '%2F').replace(/@/g, '%40');
            }
           
           
           
            //event handle for keyboard navigation
            if(options.useKeyboardShortcuts){
                document.onkeydown = function(e){   
					if (e == null) { // ie
						keycode = event.keyCode;
					} 
					else { // mozilla
						keycode = e.which;
					}
					
					switch (keycode) {
						case 37:
							//prev image
							$('.gallery-hover-nav span.prev').click();
							break;
						
						case 39:
							//next image
							$('.gallery-hover-nav span.next').click();
							break;
					}
				};
            }
           
            function updateAds()
            {
            
   $('.autoHeight').each(function() {
        $(this).attr({src: $(this).attr("src")});
	
      });

            } 
            //methods for statistic
            function updateStatistics()
            {
            	var statStr = "/fatazilei/" + (galleryName).replace(/[^a-zA-Z0-9]/g,'_') + "/" + parseInt(currentImage + 1);
	            

	            //update Google Analytics tracker
                    gaUrl = statStr;
	            if (o.useGA) {
                    if(ga_first == true){
                        ga_first = false;
                    } else {
                        try {
                            if(gAnalytics.length > 0 ) _gaq.push(['_trackPageview', gaUrl]);
                            if(gAnalytics.length > 1 ) _gaq.push(['b._trackPageview', gaUrl]);
                            if(gAnalytics.length > 2 ) _gaq.push(['c._trackPageview', gaUrl]);
                        }catch(err){}
                    }
	            }

	            //update the BRAT if the page set one.
	            if (o.useBRAT) {
                    if(satiSiteCode1 != 'undefined'){
                        br_sitecode = satiSiteCode1;
                        br_sitepath = "";
                        IVW="http://"+br_sitecode+".count.brat-online.ro/cgi-bin/cnt/CP/"+br_sitepath;
                        
                        br_sitecode2 = satiSiteCode2;
                        br_sitepath2 = satiSitePath;
                        IVW2="http://"+br_sitecode2+".count.brat-online.ro/cgi-bin/cnt/CP/"+br_sitepath2;
                        
                        bratNetwork = $("#Cbrat");
                        bratNetwork.html("<IMG SRC=\""+IVW+"?r="+escape(document.referrer)+"&d="+(Math.random()*100000)+"&x="+screen.width+"x"+screen.height+"\" WIDTH=\"1\" HEIGHT=\"1\"><IMG SRC=\""+IVW2+"?r="+escape(document.referrer)+"&d="+(Math.random()*100000)+"&x="+screen.width+"x"+screen.height+"\" WIDTH=\"1\" HEIGHT=\"1\">");
                    	o.useBRAT = false; 
                    }

	            }
                if(o.useTrafic) {
                    /*$('#reloadTrafic').each(function() {
                        this.contentWindow.location.reload(true);
                    });*/
                }
                if(o.useGemius) {
                    if (gemius_v == 1){//pt mon 
                        var pp_gemius_identifier = new String(gemiusCode);
                        //<script type="text/javascript" src="http://www.mon.hu/SysRes/MONSkin/Scripts/xgemius.js"></script>
                        $("#Cgemius").html(unescape("%3Cscript src='http://www.mon.hu/SysRes/MONSkin/Scripts/xgemius.js' type='text/javascript'%3E%3C/script%3E"));
                    }else if(gemius_v == 2){
                        gemius_identifier = new String(gemiusCode);

                        gemius_href=new String(document.location);
                        if (document.referrer) { gemius_ref = new String(document.referrer); } else { gemius_ref = ""; }
                        if(typeof(Error)!='undefined') eval("try { if (typeof(top.document.referrer)=='string') { gemius_ref = top.document.referrer } } catch(gemius_ex) {}");
                        iname = new String('id='+gemius_identifier+';ref='+escape(gemius_ref.substring(0,299))+';href='+escape(gemius_href.substring(0,299))+';');

                        $("#Cgemius").html('<div style="position:absolute; left:-500px; top:-500px;"><iframe src="http://hu.hit.gemius.pl/gemiusaudience.html" name="'+iname+'" width="1" height="1" frameborder="0" scrolling="no"><\/iframe><\/div>');
                    }
                }
	            if(o.useWA) {
                    if(webAuditArr.length > 0 ){
                        var same =  Math.floor(Math.random()*1000000);
                        var wa=new WEBAUDIT();
                        var felbontas = "";
                        var wa_url = "@u=";
                        var wa_referrer = "@r=";

                        if(wa.WACID==null)
                        {
                          wa.WACID=wa.generateID('A');
                          wa.setCookie(wa.WACIDName,wa.WACID,wa.getTopDomain(wa.getDomain(document.URL)));
                        }

                        same = same + "@c=" + wa.WACID;
                        if(screen) felbontas='@s='+screen.width+'x'+screen.height;
                        if(document.referrer) wa_referrer=wa_referrer+document.referrer;
                        if(document.URL) wa_url=wa_url+document.URL;
                        same = same + felbontas + wa_url + wa_referrer;
                        wA = '';
                        for (i=0;i<webAuditArr.length;i++){
                           wA = wA + '<!-- Median WebAudit Magyar Online --><img style="position:absolute;top:-100px;left:-100px" src="http://audit.median.hu/cgi-bin/track.cgi?uc='+webAuditArr[i]+'&dc=1&ui='+same+'" width="1" height="1">'; 
                        }
                        webAuditD = $("#CwA");
                        webAuditD.html(wA);
                    }
                }
	            //update WebTrends
	            if (o.useWT) {
	            	dcsMultiTrack("DCS.dcsuri","/galleries", "DCSext.diashow_page",galleryName, "DCSext.img_cat_1",location.hostname, "DCSext.img_cat_2",galleryName, "DCSext.img_cat_3",parseInt(currentImage + 1) + "/" + totalImages);
	            }
            }
            
        }); //this.each
    }; //fn.gallery
})(jQuery);


/**
* mcomClickableBox plugin
*
* Copyright (c) 2009 medienhaus.com
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
*
*/

jQuery.fn.mcomClickableBox = function() {

// default: get child items by class and links by class

$(this).find(".Item").each(function(i) {
    var link = $(this).find("a.Click");

    if ($(link).length > 0) {
        $(this).css("cursor", "pointer");
        $(this).click(function() {
            document.location.href = $(link).attr("href");
        });
    }
});

};


/*
* jQuery UI Tabs 1.7
*
* Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT (MIT-LICENSE.txt)
* and GPL (GPL-LICENSE.txt) licenses.
*
* http://docs.jquery.com/UI/Tabs
*
* Depends:
*	ui.core.js
*/
(function($) {

    $.widget("ui.tabs", {

        _init: function() {
            if (this.options.deselectable !== undefined) {
                this.options.collapsible = this.options.deselectable;
            }
            this._tabify(true);
        },

        _setData: function(key, value) {
            if (key == 'selected') {
                if (this.options.collapsible && value == this.options.selected) {
                    return;
                }
                this.select(value);
            }
            else {
                this.options[key] = value;
                if (key == 'deselectable') {
                    this.options.collapsible = value;
                }
                this._tabify();
            }
        },

        _tabId: function(a) {
            return a.title && a.title.replace(/\s/g, '_').replace(/[^A-Za-z0-9\-_:\.]/g, '') ||
			this.options.idPrefix + $.data(a);
        },

        _sanitizeSelector: function(hash) {
            return hash.replace(/:/g, '\\:'); // we need this because an id may contain a ":"
        },

        _cookie: function() {
            var cookie = this.cookie || (this.cookie = this.options.cookie.name || 'ui-tabs-' + $.data(this.list[0]));
            return $.cookie.apply(null, [cookie].concat($.makeArray(arguments)));
        },

        _ui: function(tab, panel) {
            return {
                tab: tab,
                panel: panel,
                index: this.anchors.index(tab)
            };
        },

        _cleanup: function() {
            // restore all former loading tabs labels
            this.lis.filter('.ui-state-processing').removeClass('ui-state-processing')
				.find('span:data(label.tabs)')
				.each(function() {
				    var el = $(this);
				    el.html(el.data('label.tabs')).removeData('label.tabs');
				});
        },

        _tabify: function(init) {

            this.list = this.element.children('ul:first');
            this.lis = $('li:has(a[href])', this.list);
            this.anchors = this.lis.map(function() { return $('a', this)[0]; });
            this.panels = $([]);

            var self = this, o = this.options;

            var fragmentId = /^#.+/; // Safari 2 reports '#' for an empty hash
            this.anchors.each(function(i, a) {
                var href = $(a).attr('href');

                // For dynamically created HTML that contains a hash as href IE < 8 expands
                // such href to the full page url with hash and then misinterprets tab as ajax.
                // Same consideration applies for an added tab with a fragment identifier
                // since a[href=#fragment-identifier] does unexpectedly not match.
                // Thus normalize href attribute...
                var hrefBase = href.split('#')[0], baseEl;
                if (hrefBase && (hrefBase === location.toString().split('#')[0] ||
					(baseEl = $('base')[0]) && hrefBase === baseEl.href)) {
                    href = a.hash;
                    a.href = href;
                }

                // inline tab
                if (fragmentId.test(href)) {
                    self.panels = self.panels.add(self._sanitizeSelector(href));
                }

                // remote tab
                else if (href != '#') { // prevent loading the page itself if href is just "#"
                    $.data(a, 'href.tabs', href); // required for restore on destroy

                    // TODO until #3808 is fixed strip fragment identifier from url
                    // (IE fails to load from such url)
                    $.data(a, 'load.tabs', href.replace(/#.*$/, '')); // mutable data

                    var id = self._tabId(a);
                    a.href = '#' + id;
                    var $panel = $('#' + id);
                    if (!$panel.length) {
                        $panel = $(o.panelTemplate).attr('id', id).addClass('ui-tabs-panel ui-widget-content ui-corner-bottom')
						.insertAfter(self.panels[i - 1] || self.list);
                        $panel.data('destroy.tabs', true);
                    }
                    self.panels = self.panels.add($panel);
                }

                // invalid tab href
                else {
                    o.disabled.push(i);
                }
            });

            // initialization from scratch
            if (init) {

                // attach necessary classes for styling
                this.element.addClass('ui-tabs ui-widget ui-widget-content ui-corner-all');
                this.list.addClass('ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all');
                this.lis.addClass('ui-state-default ui-corner-top');
                this.panels.addClass('ui-tabs-panel ui-widget-content ui-corner-bottom');

                // Selected tab
                // use "selected" option or try to retrieve:
                // 1. from fragment identifier in url
                // 2. from cookie
                // 3. from selected class attribute on <li>
                if (o.selected === undefined) {
                    if (location.hash) {
                        this.anchors.each(function(i, a) {
                            if (a.hash == location.hash) {
                                o.selected = i;
                                return false; // break
                            }
                        });
                    }
                    if (typeof o.selected != 'number' && o.cookie) {
                        o.selected = parseInt(self._cookie(), 10);
                    }
                    if (typeof o.selected != 'number' && this.lis.filter('.ui-tabs-selected').length) {
                        o.selected = this.lis.index(this.lis.filter('.ui-tabs-selected'));
                    }
                    o.selected = o.selected || 0;
                }
                else if (o.selected === null) { // usage of null is deprecated, TODO remove in next release
                    o.selected = -1;
                }

                // sanity check - default to first tab...
                o.selected = ((o.selected >= 0 && this.anchors[o.selected]) || o.selected < 0) ? o.selected : 0;

                // Take disabling tabs via class attribute from HTML
                // into account and update option properly.
                // A selected tab cannot become disabled.
                o.disabled = $.unique(o.disabled.concat(
				$.map(this.lis.filter('.ui-state-disabled'),
					function(n, i) { return self.lis.index(n); })
			)).sort();

                if ($.inArray(o.selected, o.disabled) != -1) {
                    o.disabled.splice($.inArray(o.selected, o.disabled), 1);
                }

                // highlight selected tab
                this.panels.addClass('ui-tabs-hide');
                this.lis.removeClass('ui-tabs-selected ui-state-active');
                if (o.selected >= 0 && this.anchors.length) { // check for length avoids error when initializing empty list
                    this.panels.eq(o.selected).removeClass('ui-tabs-hide');
                    this.lis.eq(o.selected).addClass('ui-tabs-selected ui-state-active');

                    // seems to be expected behavior that the show callback is fired
                    self.element.queue("tabs", function() {
                        self._trigger('show', null, self._ui(self.anchors[o.selected], self.panels[o.selected]));
                    });

                    this.load(o.selected);
                }

                // clean up to avoid memory leaks in certain versions of IE 6
                $(window).bind('unload', function() {
                    self.lis.add(self.anchors).unbind('.tabs');
                    self.lis = self.anchors = self.panels = null;
                });

            }
            // update selected after add/remove
            else {
                o.selected = this.lis.index(this.lis.filter('.ui-tabs-selected'));
            }

            // update collapsible
            this.element[o.collapsible ? 'addClass' : 'removeClass']('ui-tabs-collapsible');

            // set or update cookie after init and add/remove respectively
            if (o.cookie) {
                this._cookie(o.selected, o.cookie);
            }

            // disable tabs
            for (var i = 0, li; (li = this.lis[i]); i++) {
                $(li)[$.inArray(i, o.disabled) != -1 &&
				!$(li).hasClass('ui-tabs-selected') ? 'addClass' : 'removeClass']('ui-state-disabled');
            }

            // reset cache if switching from cached to not cached
            if (o.cache === false) {
                this.anchors.removeData('cache.tabs');
            }

            // remove all handlers before, tabify may run on existing tabs after add or option change
            this.lis.add(this.anchors).unbind('.tabs');

            if (o.event != 'mouseover') {
                var addState = function(state, el) {
                    if (el.is(':not(.ui-state-disabled)')) {
                        el.addClass('ui-state-' + state);
                    }
                };
                var removeState = function(state, el) {
                    el.removeClass('ui-state-' + state);
                };
                this.lis.bind('mouseover.tabs', function() {
                    addState('hover', $(this));
                });
                this.lis.bind('mouseout.tabs', function() {
                    removeState('hover', $(this));
                });
                this.anchors.bind('focus.tabs', function() {
                    addState('focus', $(this).closest('li'));
                });
                this.anchors.bind('blur.tabs', function() {
                    removeState('focus', $(this).closest('li'));
                });
            }

            // set up animations
            var hideFx, showFx;
            if (o.fx) {
                if ($.isArray(o.fx)) {
                    hideFx = o.fx[0];
                    showFx = o.fx[1];
                }
                else {
                    hideFx = showFx = o.fx;
                }
            }

            // Reset certain styles left over from animation
            // and prevent IE's ClearType bug...
            function resetStyle($el, fx) {
                $el.css({ display: '' });
                if ($.browser.msie && fx.opacity) {
                    $el[0].style.removeAttribute('filter');
                }
            }

            // Show a tab...
            var showTab = showFx ?
			function(clicked, $show) {
			    $(clicked).closest('li').removeClass('ui-state-default').addClass('ui-tabs-selected ui-state-active');
			    $show.hide().removeClass('ui-tabs-hide') // avoid flicker that way
					.animate(showFx, showFx.duration || 'normal', function() {
					    resetStyle($show, showFx);
					    self._trigger('show', null, self._ui(clicked, $show[0]));
					});
			} :
			function(clicked, $show) {
			    $(clicked).closest('li').removeClass('ui-state-default').addClass('ui-tabs-selected ui-state-active');
			    $show.removeClass('ui-tabs-hide');
			    self._trigger('show', null, self._ui(clicked, $show[0]));
			};

            // Hide a tab, $show is optional...
            var hideTab = hideFx ?
			function(clicked, $hide) {
			    $hide.animate(hideFx, hideFx.duration || 'normal', function() {
			        self.lis.removeClass('ui-tabs-selected ui-state-active').addClass('ui-state-default');
			        $hide.addClass('ui-tabs-hide');
			        resetStyle($hide, hideFx);
			        self.element.dequeue("tabs");
			    });
			} :
			function(clicked, $hide, $show) {
			    self.lis.removeClass('ui-tabs-selected ui-state-active').addClass('ui-state-default');
			    $hide.addClass('ui-tabs-hide');
			    self.element.dequeue("tabs");
			};

            // attach tab event handler, unbind to avoid duplicates from former tabifying...
            this.anchors.bind(o.event + '.tabs', function() {
                var el = this, $li = $(this).closest('li'), $hide = self.panels.filter(':not(.ui-tabs-hide)'),
					$show = $(self._sanitizeSelector(this.hash));

                // If tab is already selected and not collapsible or tab disabled or
                // or is already loading or click callback returns false stop here.
                // Check if click handler returns false last so that it is not executed
                // for a disabled or loading tab!
                if (($li.hasClass('ui-tabs-selected') && !o.collapsible) ||
				$li.hasClass('ui-state-disabled') ||
				$li.hasClass('ui-state-processing') ||
				self._trigger('select', null, self._ui(this, $show[0])) === false) {
                    this.blur();
                    return false;
                }

                o.selected = self.anchors.index(this);

                self.abort();

                // if tab may be closed
                if (o.collapsible) {
                    if ($li.hasClass('ui-tabs-selected')) {
                        o.selected = -1;

                        if (o.cookie) {
                            self._cookie(o.selected, o.cookie);
                        }

                        self.element.queue("tabs", function() {
                            hideTab(el, $hide);
                        }).dequeue("tabs");

                        this.blur();
                        return false;
                    }
                    else if (!$hide.length) {
                        if (o.cookie) {
                            self._cookie(o.selected, o.cookie);
                        }

                        self.element.queue("tabs", function() {
                            showTab(el, $show);
                        });

                        self.load(self.anchors.index(this)); // TODO make passing in node possible, see also http://dev.jqueryui.com/ticket/3171

                        this.blur();
                        return false;
                    }
                }

                if (o.cookie) {
                    self._cookie(o.selected, o.cookie);
                }

                // show new tab
                if ($show.length) {
                    if ($hide.length) {
                        self.element.queue("tabs", function() {
                            hideTab(el, $hide);
                        });
                    }
                    self.element.queue("tabs", function() {
                        showTab(el, $show);
                    });

                    self.load(self.anchors.index(this));
                }
                else {
                    throw 'jQuery UI Tabs: Mismatching fragment identifier.';
                }

                // Prevent IE from keeping other link focussed when using the back button
                // and remove dotted border from clicked link. This is controlled via CSS
                // in modern browsers; blur() removes focus from address bar in Firefox
                // which can become a usability and annoying problem with tabs('rotate').
                if ($.browser.msie) {
                    this.blur();
                }

            });

            // disable click in any case
            this.anchors.bind('click.tabs', function() { return false; });

        },

        destroy: function() {
            var o = this.options;

            this.abort();

            this.element.unbind('.tabs')
			.removeClass('ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible')
			.removeData('tabs');

            this.list.removeClass('ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all');

            this.anchors.each(function() {
                var href = $.data(this, 'href.tabs');
                if (href) {
                    this.href = href;
                }
                var $this = $(this).unbind('.tabs');
                $.each(['href', 'load', 'cache'], function(i, prefix) {
                    $this.removeData(prefix + '.tabs');
                });
            });

            this.lis.unbind('.tabs').add(this.panels).each(function() {
                if ($.data(this, 'destroy.tabs')) {
                    $(this).remove();
                }
                else {
                    $(this).removeClass([
					'ui-state-default',
					'ui-corner-top',
					'ui-tabs-selected',
					'ui-state-active',
					'ui-state-hover',
					'ui-state-focus',
					'ui-state-disabled',
					'ui-tabs-panel',
					'ui-widget-content',
					'ui-corner-bottom',
					'ui-tabs-hide'
				].join(' '));
                }
            });

            if (o.cookie) {
                this._cookie(null, o.cookie);
            }
        },

        add: function(url, label, index) {
            if (index === undefined) {
                index = this.anchors.length; // append by default
            }

            var self = this, o = this.options,
			$li = $(o.tabTemplate.replace(/#\{href\}/g, url).replace(/#\{label\}/g, label)),
			id = !url.indexOf('#') ? url.replace('#', '') : this._tabId($('a', $li)[0]);

            $li.addClass('ui-state-default ui-corner-top').data('destroy.tabs', true);

            // try to find an existing element before creating a new one
            var $panel = $('#' + id);
            if (!$panel.length) {
                $panel = $(o.panelTemplate).attr('id', id).data('destroy.tabs', true);
            }
            $panel.addClass('ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide');

            if (index >= this.lis.length) {
                $li.appendTo(this.list);
                $panel.appendTo(this.list[0].parentNode);
            }
            else {
                $li.insertBefore(this.lis[index]);
                $panel.insertBefore(this.panels[index]);
            }

            o.disabled = $.map(o.disabled,
			function(n, i) { return n >= index ? ++n : n; });

            this._tabify();

            if (this.anchors.length == 1) { // after tabify
                $li.addClass('ui-tabs-selected ui-state-active');
                $panel.removeClass('ui-tabs-hide');
                this.element.queue("tabs", function() {
                    self._trigger('show', null, self._ui(self.anchors[0], self.panels[0]));
                });

                this.load(0);
            }

            // callback
            this._trigger('add', null, this._ui(this.anchors[index], this.panels[index]));
        },

        remove: function(index) {
            var o = this.options, $li = this.lis.eq(index).remove(),
			$panel = this.panels.eq(index).remove();

            // If selected tab was removed focus tab to the right or
            // in case the last tab was removed the tab to the left.
            if ($li.hasClass('ui-tabs-selected') && this.anchors.length > 1) {
                this.select(index + (index + 1 < this.anchors.length ? 1 : -1));
            }

            o.disabled = $.map($.grep(o.disabled, function(n, i) { return n != index; }),
			function(n, i) { return n >= index ? --n : n; });

            this._tabify();

            // callback
            this._trigger('remove', null, this._ui($li.find('a')[0], $panel[0]));
        },

        enable: function(index) {
            var o = this.options;
            if ($.inArray(index, o.disabled) == -1) {
                return;
            }

            this.lis.eq(index).removeClass('ui-state-disabled');
            o.disabled = $.grep(o.disabled, function(n, i) { return n != index; });

            // callback
            this._trigger('enable', null, this._ui(this.anchors[index], this.panels[index]));
        },

        disable: function(index) {
            var self = this, o = this.options;
            if (index != o.selected) { // cannot disable already selected tab
                this.lis.eq(index).addClass('ui-state-disabled');

                o.disabled.push(index);
                o.disabled.sort();

                // callback
                this._trigger('disable', null, this._ui(this.anchors[index], this.panels[index]));
            }
        },

        select: function(index) {
            if (typeof index == 'string') {
                index = this.anchors.index(this.anchors.filter('[href$=' + index + ']'));
            }
            else if (index === null) { // usage of null is deprecated, TODO remove in next release
                index = -1;
            }
            if (index == -1 && this.options.collapsible) {
                index = this.options.selected;
            }

            this.anchors.eq(index).trigger(this.options.event + '.tabs');
        },

        load: function(index) {
            var self = this, o = this.options, a = this.anchors.eq(index)[0], url = $.data(a, 'load.tabs');

            this.abort();

            // not remote or from cache
            if (!url || this.element.queue("tabs").length !== 0 && $.data(a, 'cache.tabs')) {
                this.element.dequeue("tabs");
                return;
            }

            // load remote from here on
            this.lis.eq(index).addClass('ui-state-processing');

            if (o.spinner) {
                var span = $('span', a);
                span.data('label.tabs', span.html()).html(o.spinner);
            }

            this.xhr = $.ajax($.extend({}, o.ajaxOptions, {
                url: url,
                success: function(r, s) {
                    $(self._sanitizeSelector(a.hash)).html(r);

                    // take care of tab labels
                    self._cleanup();

                    if (o.cache) {
                        $.data(a, 'cache.tabs', true); // if loaded once do not load them again
                    }

                    // callbacks
                    self._trigger('load', null, self._ui(self.anchors[index], self.panels[index]));
                    try {
                        o.ajaxOptions.success(r, s);
                    }
                    catch (e) { }

                    // last, so that load event is fired before show...
                    self.element.dequeue("tabs");
                }
            }));
        },

        abort: function() {
            // stop possibly running animations
            this.element.queue([]);
            this.panels.stop(false, true);

            // terminate pending requests from other tabs
            if (this.xhr) {
                this.xhr.abort();
                delete this.xhr;
            }

            // take care of tab labels
            this._cleanup();

        },

        url: function(index, url) {
            this.anchors.eq(index).removeData('cache.tabs').data('load.tabs', url);
        },

        length: function() {
            return this.anchors.length;
        }

    });

    $.extend($.ui.tabs, {
        version: '1.7',
        getter: 'length',
        defaults: {
            ajaxOptions: null,
            cache: false,
            cookie: null, // e.g. { expires: 7, path: '/', domain: 'jquery.com', secure: true }
            collapsible: false,
            disabled: [],
            event: 'click',
            fx: null, // e.g. { height: 'toggle', opacity: 'toggle', duration: 200 }
            idPrefix: 'ui-tabs-',
            panelTemplate: '<div></div>',
            spinner: '<em>Loading&#8230;</em>',
            tabTemplate: '<li><a href="#{href}"><span>#{label}</span></a></li>'
        }
    });

    /*
    * Tabs Extensions
    */

    /*
    * Rotate
    */
    $.extend($.ui.tabs.prototype, {
        rotation: null,
        rotate: function(ms, continuing) {

            var self = this, o = this.options;

            var rotate = self._rotate || (self._rotate = function(e) {
                clearTimeout(self.rotation);
                self.rotation = setTimeout(function() {
                    var t = o.selected;
                    self.select(++t < self.anchors.length ? t : 0);
                }, ms);

                if (e) {
                    e.stopPropagation();
                }
            });

            var stop = self._unrotate || (self._unrotate = !continuing ?
			function(e) {
			    if (e.clientX) { // in case of a true click
			        self.rotate(null);
			    }
			} :
			function(e) {
			    t = o.selected;
			    rotate();
			});

            // start rotation
            if (ms) {
                this.element.bind('tabsshow', rotate);
                this.anchors.bind(o.event + '.tabs', stop);
                rotate();
            }
            // stop rotation
            else {
                clearTimeout(self.rotation);
                this.element.unbind('tabsshow', rotate);
                this.anchors.unbind(o.event + '.tabs', stop);
                delete this._rotate;
                delete this._unrotate;
            }
        }
    });

})(jQuery);

/**
* hoverIntent is similar to jQuery's built-in "hover" function except that
* instead of firing the onMouseOver event immediately, hoverIntent checks
* to see if the user's mouse has slowed down (beneath the sensitivity
* threshold) before firing the onMouseOver event.
* 
* hoverIntent r5 // 2007.03.27 // jQuery 1.1.2+
* <http://cherne.net/brian/resources/jquery.hoverIntent.html>
* 
* hoverIntent is currently available for use in all personal or commercial 
* projects under both MIT and GPL licenses. This means that you can choose 
* the license that best suits your project, and use it accordingly.
* 
* // basic usage (just like .hover) receives onMouseOver and onMouseOut functions
* $("ul li").hoverIntent( showNav , hideNav );
* 
* // advanced usage receives configuration object only
* $("ul li").hoverIntent({
*	sensitivity: 7, // number = sensitivity threshold (must be 1 or higher)
*	interval: 100,   // number = milliseconds of polling interval
*	over: showNav,  // function = onMouseOver callback (required)
*	timeout: 0,   // number = milliseconds delay before onMouseOut function call
*	out: hideNav    // function = onMouseOut callback (required)
* });
* 
* @param  f  onMouseOver function || An object with configuration options
* @param  g  onMouseOut function  || Nothing (use configuration options object)
* @author    Brian Cherne <brian@cherne.net>
*/
(function($) {
    $.fn.hoverIntent = function(f, g) {
        // default configuration options
        var cfg = {
            sensitivity: 7,
            interval: 100,
            timeout: 0
        };
        // override configuration options with user supplied object
        cfg = $.extend(cfg, g ? { over: f, out: g} : f);

        // instantiate variables
        // cX, cY = current X and Y position of mouse, updated by mousemove event
        // pX, pY = previous X and Y position of mouse, set by mouseover and polling interval
        var cX, cY, pX, pY;

        // A private function for getting mouse position
        var track = function(ev) {
            cX = ev.pageX;
            cY = ev.pageY;
        };

        // A private function for comparing current and previous mouse position
        var compare = function(ev, ob) {
            ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t);
            // compare mouse positions to see if they've crossed the threshold
            if ((Math.abs(pX - cX) + Math.abs(pY - cY)) < cfg.sensitivity) {
                $(ob).unbind("mousemove", track);
                // set hoverIntent state to true (so mouseOut can be called)
                ob.hoverIntent_s = 1;
                return cfg.over.apply(ob, [ev]);
            } else {
                // set previous coordinates for next time
                pX = cX; pY = cY;
                // use self-calling timeout, guarantees intervals are spaced out properly (avoids JavaScript timer bugs)
                ob.hoverIntent_t = setTimeout(function() { compare(ev, ob); }, cfg.interval);
            }
        };

        // A private function for delaying the mouseOut function
        var delay = function(ev, ob) {
            ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t);
            ob.hoverIntent_s = 0;
            return cfg.out.apply(ob, [ev]);
        };

        // A private function for handling mouse 'hovering'
        var handleHover = function(e) {
            // next three lines copied from jQuery.hover, ignore children onMouseOver/onMouseOut
            var p = (e.type == "mouseover" ? e.fromElement : e.toElement) || e.relatedTarget;
            while (p && p != this) { try { p = p.parentNode; } catch (e) { p = this; } }
            if (p == this) { return false; }

            // copy objects to be passed into t (required for event object to be passed in IE)
            var ev = jQuery.extend({}, e);
            var ob = this;

            // cancel hoverIntent timer if it exists
            if (ob.hoverIntent_t) { ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t); }

            // else e.type == "onmouseover"
            if (e.type == "mouseover") {
                // set "previous" X and Y position based on initial entry point
                pX = ev.pageX; pY = ev.pageY;
                // update "current" X and Y position based on mousemove
                $(ob).bind("mousemove", track);
                // start polling interval (self-calling timeout) to compare mouse coordinates over time
                if (ob.hoverIntent_s != 1) { ob.hoverIntent_t = setTimeout(function() { compare(ev, ob); }, cfg.interval); }

                // else e.type == "onmouseout"
            } else {
                // unbind expensive mousemove event
                $(ob).unbind("mousemove", track);
                // if hoverIntent state is true, then call the mouseOut function after the specified delay
                if (ob.hoverIntent_s == 1) { ob.hoverIntent_t = setTimeout(function() { delay(ev, ob); }, cfg.timeout); }
            }
        };

        // bind the function to the two event listeners
        return this.mouseover(handleHover).mouseout(handleHover);
    };
})(jQuery);


function MostViewedBox(strContainerId, iBoxHeight) {

    //properties
    this.strContainerId = strContainerId;
    this.iBoxHeight = iBoxHeight;
}

MostViewedBox.prototype.Render = function() {

    // get tabs
    var box = $("#" + this.strContainerId);

    $(box).tabs();

    // activate first element
    $(box).find("div[id!='']").each(function(i) { hover($(this).find("div:first")) });

    // hover effect
    $(box).find("div.Item").hoverIntent({
        over: function() {
            hover(this);
        },
        out:
         function() {
             // do nothing
         }
    });

    // make clickable
    $(box).mcomClickableBox();

   


    function hover(object) {
        // reset eventually hovered items
        $(object).parent().find(".ui-hover").each(function(i) {
            unhover(this)
        });

        // add css class
        $(object).addClass("ui-hover");

        // rounded corners
        $(object).find("span.Pic").corner("5px");
        
    }

    function unhover(object) {
        $(object).removeClass("ui-hover");
        $(object).find("td:hidden").show();
        $(object).find("td.Detail").hide();
    }
}

function loadpage(page_request, containerid){
	if (page_request.readyState == 4 && (page_request.status==200 || window.location.href.indexOf("http")==-1)){
 		var Result = page_request.responseText.split("||javascript||");
 		document.getElementById(containerid).innerHTML=Result[0];
 		if(Result[1]) 
			eval(Result[1]);
	}
}
