//var _isIE_ 		= (navigator.userAgent.indexOf("MSIE") > 0);
//var _isIEOld_   = (_isIE_ && (navigator.appVersion.indexOf("MSIE 6") > 0));

var _active_div = ''; //this must be set on each page with a tab to the currently selected tab
showTab = function(tab) {	
	if (_active_div != '' && _active_div != tab) {
		if (document.getElementById(_active_div)) {
			document.getElementById(_active_div).style.display = 'none';
			document.getElementById(_active_div+'_sel').className = '';
		}	
	}
	
	if (document.getElementById(tab) && document.getElementById(tab).style.display == 'none') {
		document.getElementById(tab).style.display = 'block';
		document.getElementById(tab+'_sel').className = 'selected';
		_active_div = tab;
	}
}

_toggleDiv = function(div) {
	if ($("#"+div)) {
	    ($("#"+div).css('display') == 'none') ? $("#"+div).show() : $("#"+div).hide();
	}
}

// requires /media/js/jquery.swfobject.1-0-9.min.js
var _viewFlashVid = [];
viewFlash = function(div, w, h, id, lk, wide) {
    wide = (wide == undefined) ? 0 : ((wide == 'True') ? 1 : 0);

    if ($("#"+div)) {
        if ($("#"+div).css('display') == 'none') {
            if (_viewFlashVid[id] == undefined) {
                $('#'+div).flash({   
                    swf: 'http://flash.blueloot.com/embedplayer.swf',
                    width: w,
                    height: h,
                    hasVersion: 9,
                    type: 'application/x-shockwave-flash',
            		pluginspage: 'http://www.adobe.com/go/getflashplayer',
                    flashvars: {
                        vid: id,
                        wide: wide,
                        lk: lk
                    },
                    params: {
                        quality: "high",
                        align: "middle",
                        bgcolor: '#0f2e4a',
                        menu: false,
                        allowFullScreen: false,
                        allowScriptAccess: "sameDomain",
                        loop: false
                      }
                 }
                );
                _viewFlashVid[id] = 1;
            }
            $("#"+div).show();    
        }
        else
            $("#"+div).hide();
    }    
}

visit = function(url){
	window.open(url);
}

getCookie = function(ckname) { var cname = ckname + "="; var dc = document.cookie; if (dc.length > 0) { cbegin = dc.indexOf(cname); if (cbegin != -1) { cbegin += cname.length; cend = dc.indexOf(";", cbegin); if (cend == -1) cend = dc.length; return unescape(dc.substring(cbegin, cend)); } } return null; };
delCookie = function(cname,path,domain) { if (getCookie(cname))  document.cookie = cname + "=" + ((path == null) ? "" : "; path=" + path) + ((domain == null) ? "" : "; domain=" + domain) + "; expires=Thu, 01-Jan-70 00:00:01 GMT"; };
setCookie = function(cname, value, expires, path, domain, secure) {  document.cookie = cname + "=" + escape(value) + ((expires == null) ? "" : "; expires=" + expires.toGMTString()) +  ((path == null) ? "" : "; path=" + path) + ((domain == null) ? "" : "; domain=" + domain) +  ((secure == null) ? "" : "; secure"); };

