

// DROP DOWN MENU
// original source: http://solardreamstudios.com/learn/css/cssmenus 
navHover = function() {
	var lis = document.getElementById("mn").getElementsByTagName("LI");
	for (var i=0; i<lis.length; i++) {
		lis[i].onmouseover=function() {
			this.className+=" iehover";
		}
		lis[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" iehover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", navHover);
function hideShowDiv(link, divID) {

         if(typeof(link)=="object") {
            linkObject = link;
         }
         else {
            linkObject = document.getElementById(link);
         }

         currentdiv = document.getElementById(divID);

         if(currentdiv.style.display == "block"){
            s = new String(linkObject.innerHTML);
           currentdiv.style.display = "";
            }
         else {
             if(currentdiv.style.display == ""){
                s = new String(linkObject.innerHTML);
                currentdiv.style.display = "block";
                }
         }
      }

$(document).ready(function() {
                                $(function() {
                                   
	$('#cir_module_slimbox a').fancybox({type:'iframe', height:'500'});
	$('#exec_module_slimbox a').fancybox({type:'iframe', height:450,scrolling:'no'});
	$('.gallery_image').fancybox({titleShow:false});
	$('div.group_small_popup a').each(function(index){$(this).attr('rel','group')});
	$('div.group_small_popup a').fancybox({type:'iframe','autoDimensions':false,'height':220, 'width':570});

$('div.group_multi_popup a').each(function(index){$(this).attr('rel','group')});
	$('div.group_multi_popup a').fancybox();
	$(".video_link").click(function(){
   $.fancybox({
			'padding'		: 0,
			'autoScale'		: false,
			'transitionIn'	: 'none',
			'transitionOut'	: 'none',
			'titleShow' : false,
			'width'		: 480,
       			'href'    : "http://www.youtube.com/v/"+this.href.split("v=")[1]+"?fs=1&autoplay=1",
			'height'		: 295,
			'type'			: 'swf',
			'swf'			: {
			   	 'wmode'		: 'transparent',
				'allowfullscreen'	: 'true'
			}
		});
		return false;
		});
	
	
 });
});

function resizeFancyBox()
{
        var iFrameContentHeight = $('#fancybox-frame').contents().find("html").height();
        var iFrameContentWidth = $('#fancybox-frame').contents().find("html").width(); // id of iframe

        var outer = $('#fancybox-wrap');
        var inner = $('#fancybox-inner');
        var paddingTotal = 60;
        var extra = 20; // some extra space to avoid Scrollbars

        if(iFrameContentHeight > 0 && iFrameContentWidth > 0){
                outer.css({
                        height: iFrameContentHeight + paddingTotal + extra,
                        width: iFrameContentWidth + paddingTotal + extra
                });
                inner.css({
                        height: iFrameContentHeight + extra,
                        width: iFrameContentWidth + extra
                });
                $.fancybox.center();
        }

} 
