function getinfo(id)
{
	for(var i=1;i<=8;i++)
	{
		$('#Show_Info_'+i).hide();
	}

	$('#Show_Info_'+id).show();
}

function getSearchType(evt) {
    var e = evt || window.event;
    var n = e.srcElement || e.target;
    if (n && n.tagName != 'LI') return;
    n.parentNode.parentNode.getElementsByTagName('h6')[0].innerHTML = n.innerHTML;
    var lis = n.parentNode.getElementsByTagName('li');
    for (var i = 0,
    j = lis.length; i < j; i++) {
        lis[i].style.display = '';
    }
    n.style.display = 'none';
    $('#moduleid').val(n.getAttribute('val'));
    n.parentNode.style.display = 'none';
//    alert($('#typeid').val());
}

var BROWSER = {};
var USERAGENT = navigator.userAgent.toLowerCase();
browserVersion({ 'ie': 'msie', 'firefox': '', 'chrome': '', 'opera': '', 'safari': '', 'mozilla': '', 'webkit': '', 'maxthon': '', 'qq': 'qqbrowser' });
if (BROWSER.safari) {
    BROWSER.firefox = true;
}
BROWSER.opera = BROWSER.opera ? opera.version() : 0;

HTMLNODE = document.getElementsByTagName('head')[0].parentNode;
if (BROWSER.ie) {
    BROWSER.iemode = parseInt(typeof document.documentMode != 'undefined' ? document.documentMode : BROWSER.ie);
    HTMLNODE.className = 'ie_all ie' + BROWSER.iemode;
}

function browserVersion(types) {
    var other = 1;
    for (i in types) {
        var v = types[i] ? types[i] : i;
        if (USERAGENT.indexOf(v) != -1) {
            var re = new RegExp(v + '(\\/|\\s)([\\d\\.]+)', 'ig');
            var matches = re.exec(USERAGENT);
            var ver = matches != null ? matches[2] : 0;
            other = ver !== 0 && v != 'mozilla' ? 0 : other;
        } else {
            var ver = 0;
        }
        eval('BROWSER.' + i + '= ver');
    }
    BROWSER.other = other;
}


function showTopLink() {
    var ft = $('#ft');
    if (ft) {
        var scrolltop = $('#scrolltop');
        var viewPortHeight = parseInt(document.documentElement.clientHeight);
        var scrollHeight = parseInt(document.body.getBoundingClientRect().top);
        var basew = parseInt(ft.clientWidth);
        var sw = scrolltop.clientWidth;
        if (basew < 1000) {
            var left = parseInt(fetchOffset(ft)['left']);
            left = left < sw ? left * 2 - sw : left;
      
            scrolltop.css("left", (basew + left) + 'px');
        } else {
            scrolltop.css("left",'auto');
            scrolltop.css("right", '0');
        }

        if (BROWSER.ie && BROWSER.ie < 7) {
     
            scrolltop.css("top", viewPortHeight - scrollHeight - 150 + 'px');
        }
        if (scrollHeight < -100) {
            scrolltop.css("display", "");
        } else {
            scrolltop.css("display", "none");
          
        }
    }
}


function fetchOffset(obj, mode) {
    var left_offset = 0, top_offset = 0, mode = !mode ? 0 : mode;

    if (obj.getBoundingClientRect && !mode) {
        var rect = obj.getBoundingClientRect();
        var scrollTop = Math.max(document.documentElement.scrollTop, document.body.scrollTop);
        var scrollLeft = Math.max(document.documentElement.scrollLeft, document.body.scrollLeft);
        if (document.documentElement.dir == 'rtl') {
            scrollLeft = scrollLeft + document.documentElement.clientWidth - document.documentElement.scrollWidth;
        }
        left_offset = rect.left + scrollLeft - document.documentElement.clientLeft;
        top_offset = rect.top + scrollTop - document.documentElement.clientTop;
    }
    if (left_offset <= 0 || top_offset <= 0) {
        left_offset = obj.offsetLeft;
        top_offset = obj.offsetTop;
        while ((obj = obj.offsetParent) != null) {
            position = getCurrentStyle(obj, 'position', 'position');
            if (position == 'relative') {
                continue;
            }
            left_offset += obj.offsetLeft;
            top_offset += obj.offsetTop;
        }
    }
    return { 'left': left_offset, 'top': top_offset };
}

function _attachEvent(obj, evt, func, eventobj) {
    eventobj = !eventobj ? obj : eventobj;
    if (obj.addEventListener) {
        obj.addEventListener(evt, func, false);
    } else if (eventobj.attachEvent) {
        obj.attachEvent('on' + evt, func);
    }
}


function DivOpen(id)
{
    $(id).css("display", "");
}

function DivClose(id)
{
    $(id).css("display", "none");
}



function Get_Flash(ur, w, h) {
    document.write('<object classid="clsid:D27CDB6E-AE6D-11CF-96B8-444553540000" id="obj1" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" border="0" width="' + w + '" height="' + h + '">');
    document.write('<param name="movie" value="' + ur + '">');
    document.write('<param name="quality" value="high"> ');
    document.write('<param name="wmode" value="transparent"> ');
    document.write('<param name="menu" value="false"> ');
    document.write('<embed src="' + ur + '" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" name="obj1" width="' + w + '" height="' + h + '" quality="High" wmode="transparent">');
    document.write('</embed>');
    document.write('</object>');
}