
		
stdBrowser = (document.getElementById) ? true : false

function toggleMenuOver(currElem,id) {
			
	var mainimage = document.getElementById(id);
			
			var h = mainimage.offsetHeight;
			var w = mainimage.offsetWidth;
			
			var x = getElementLeft(mainimage);
			var y = getElementTop(mainimage);
			
			//alert('x: '+x+' y:'+y);
			
			menuObj = (stdBrowser) ? document.getElementById(currElem).style : eval('document.' + currElem)
			menuObj.top = (y + h) + 'px';
			menuObj.left = x + 'px';
			menuObj.visibility = 'visible'
			
			
	}
		
function toggleMenuOut(currElem,topPos,leftPos) {

			menuObj = (stdBrowser) ? document.getElementById(currElem).style : eval('document.' + currElem)
			menuObj.top = (stdBrowser) ? topPos + 'px' : topPos
			menuObj.left = (stdBrowser) ? leftPos + 'px' : leftPos
			menuObj.visibility = 'hidden'
}
		
		
function getElementLeft(elm) {
    var x = 0;

    //set x to elm’s offsetLeft
    x = elm.offsetLeft;

    //set elm to its offsetParent
    elm = elm.offsetParent;

    //use while loop to check if elm is null
    // if not then add current elm’s offsetLeft to x
    //offsetTop to y and set elm to its offsetParent

    while(elm != null)
    {
        x = parseInt(x) + parseInt(elm.offsetLeft);
        elm = elm.offsetParent;
    }
    return x;
}

function getElementTop(elm) {
    var y = 0;

    //set x to elm’s offsetLeft
    y = elm.offsetTop;

    //set elm to its offsetParent
    elm = elm.offsetParent;

    //use while loop to check if elm is null
    // if not then add current elm’s offsetLeft to x
    //offsetTop to y and set elm to its offsetParent

    while(elm != null)
    {
        y = parseInt(y) + parseInt(elm.offsetTop);
        elm = elm.offsetParent;
    }

    return y;
}

var win = null;

function newWindow(mypage,myname,w,h,scroll){
	
	LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
	TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
	settings ='height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable=yes';
	win = window.open(mypage,myname,settings);
}


function showPopUp(el) {
var cvr = document.getElementById('cover')
var dlg = document.getElementById(el)

var divimg = dlg.getElementsByTagName('img')[0];


cvr.style.display = 'block'

dlg.style.top = '0px';
dlg.style.left = '0px';

dlg.style.width = '100%';
dlg.style.height = '100%';


//alert(screen.width + 'px');

dlg.style.display = 'block'
	
	
}

function showPopUpVideo(el, videosrc, videoheight, videowidth) {
var cvr = document.getElementById('cover')
var dlg = document.getElementById(el)
var videocontainer = document.getElementById('videocontainer');

// videocontainer.innerHTML = "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' height='" + videoheight + "' width='" + videowidth + "' id='FLVPlayer'><param name='movie' value='FLVPlayer_Progressive.swf' /><param name='quality' value='high' /><param name='wmode' value='opaque' /><param name='scale' value='noscale' /><param name='salign' value='lt' /><param id='FlashVars' name='FlashVars' value='&amp;MM_ComponentVersion=1&amp;skinName=Clear_Skin_1&amp;streamName=../images/videos/" + videosrc + "&amp;autoPlay=true&amp;autoRewind=false' /><param name='swfversion' value='8,0,0,0' /><!-- This param tag prompts users with Flash Player 6.0 r65 and higher to download the latest version of Flash Player. Delete it if you don’t want users to see the prompt. --><param name='expressinstall' value='scripts/expressInstall.swf' /><!-- Next object tag is for non-IE browsers. So hide it from IE using IECC. --><!--[if !IE]>--><object type='application/x-shockwave-flash' data='FLVPlayer_Progressive.swf' ><!--<![endif]--><param name='quality' value='high' /><param name='wmode' value='opaque' /><param name='scale' value='noscale' /><param name='salign' value='lt' /><param id='FlashVars' name='FlashVars' value='&amp;MM_ComponentVersion=1&amp;skinName=Clear_Skin_1&amp;streamName=../images/videos/&amp;autoPlay=true&amp;autoRewind=false' /><param name='swfversion' value='8,0,0,0' /><param name='expressinstall' value='scripts/expressInstall.swf' /><!-- The browser displays the following alternative content for users with Flash Player 6.0 and older. --><div><h4>Content on this page requires a newer version of Adobe Flash Player.</h4><p><a href='http://www.adobe.com/go/getflashplayer'><img src='http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif' alt='Get Adobe Flash player' /></a></p></div><!--[if !IE]>--></object><!--<![endif]--></object>";

videocontainer.innerHTML = "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' width='" + videowidth + "' height='" + videoheight + "' id='FLVPlayer'><param name='movie' value='FLVPlayer_Progressive.swf' /><param name='quality' value='high' /><param name='wmode' value='opaque' /><param name='scale' value='noscale' /><param name='salign' value='lt' /><param name='FlashVars' value='&amp;MM_ComponentVersion=1&amp;skinName=Clear_Skin_1&amp;streamName=../images/videos/" + videosrc + "&amp;autoPlay=true&amp;autoRewind=true' /><param name='swfversion' value='8,0,0,0' /><object type='application/x-shockwave-flash' data='FLVPlayer_Progressive.swf' width='" + videowidth + "' height='" + videoheight + "'><param name='quality' value='high' /><param name='wmode' value='opaque' /><param name='scale' value='noscale' /><param name='salign' value='lt' /><param name='FlashVars' value='&amp;MM_ComponentVersion=1&amp;skinName=Clear_Skin_1&amp;streamName=../images/videos/" + videosrc + "&amp;autoPlay=true&amp;autoRewind=true' /><param name='swfversion' value='8,0,0,0' /><param name='expressinstall' value='../scripts/expressInstall.swf' /></object></object>";
			
cvr.style.display = 'block'

dlg.style.top = '0px';
dlg.style.left = '0px';

dlg.style.width = '100%';
dlg.style.height = '100%';

videocontainer.style.width = videowidth;
videocontainer.style.height = videoheight;

dlg.style.display = 'block'
	
	
}

function closePopUp(el) {
var cvr = document.getElementById('cover')
var dlg = document.getElementById(el)
cvr.style.display = 'none'
dlg.style.display = 'none'
document.body.style.overflowY = 'scroll'
}

function closePopUpVideo(el) {
var cvr = document.getElementById('cover')
var dlg = document.getElementById(el)
cvr.style.display = 'none'
dlg.style.display = 'none'
document.body.style.overflowY = 'scroll'
videocontainer.innerHTML = "";
}
