﻿function PopUp(what){
	window.open(what,'PopUp','top=100,screenx=100,left=100,screeny=100,width=550,height=500,buttons=no,scrollbars=no,location=no,menubar=no,resizable=no,status=no,directories=no,toolbar=no');}
	
function AudioPopUp(what){
	window.open(what,'PopUp','top=100,screenx=100,left=100,screeny=100,width=550,height=500,buttons=no,scrollbars=no,location=no,menubar=no,resizable=no,status=no,directories=no,toolbar=no');}

function ArchivePopUp(what){
	window.open(what,'PopUp','top=100,screenx=100,left=100,screeny=100,width=300,height=200,buttons=no,scrollbars=no,location=no,menubar=no,resizable=no,status=no,directories=no,toolbar=no');}

function MediaPopUp(what){
	window.open(what,'PopUp','top=100,screenx=100,left=100,screeny=100,width=550,height=570,buttons=no,scrollbars=no,location=no,menubar=no,resizable=no,status=no,directories=no,toolbar=no');}
	

function showTip(tipFld, imgFld) {
    document.getElementById(tipFld).style.visibility = 'visible';
    document.getElementById(tipFld).style.display = 'block';
    document.getElementById(tipFld).style.left = (findPosX(document.getElementById(imgFld)) - 100) + 'px';
}

function hideTip(tipFld) {
    document.getElementById(tipFld).style.visibility = 'hidden';
    document.getElementById(tipFld).style.display = 'none';
    //document.getElementById(tipFld).style.left = '-1000em';
    document.getElementById(tipFld).style.left = (findPosX(document.getElementById(tipFld)) - 100) + 'px';
}

function findPosX(obj) {
    var curleft = 0;
    if (obj.offsetParent)
        while (1) {
        curleft += obj.offsetLeft;
        if (!obj.offsetParent)
            break;
        obj = obj.offsetParent;
    }
    else if (obj.x)
        curleft += obj.x;
    return curleft;
}

function findPosY(obj) {
    var curtop = 0;
    if (obj.offsetParent)
        while (1) {
        curtop += obj.offsetTop;
        if (!obj.offsetParent)
            break;
        obj = obj.offsetParent;
    }
    else if (obj.y)
        curtop += obj.y;
    return curtop;
}


function gety() {
    var e = (window.event) ? window.event : event;
    return event.clientY;
}

function getx() {
    var e = (window.event) ? window.event : event;
    return event.clientX;
}

function breakAway(mode) {
    var origPlayer = window.document.location.toString();
  	var popupPlayer = origPlayer.replace(/Player/, 'MiniPlayer');
  	if (mode == 'gallery')
  	    popupPlayer = origPlayer.replace(/Gallery/, 'MiniGallery');
	//clearTabs();
	window.open(popupPlayer,'PopUp','top=100,screenx=100,left=100,screeny=100,width=480,height=400,buttons=no,scrollbars=no,location=no,menubar=no,resizable=no,status=no,directories=no,toolbar=no');
	parent.playGallery('featured_photo');
	parent.HideModalPopup();
}

function playPreview(clipGuid) {
	window.open('MultimediaCenter/MiniPlayer.aspx?Guid=' + clipGuid,'PopUp','top=100,screenx=100,left=100,screeny=100,width=480,height=425,buttons=no,scrollbars=no,location=no,menubar=no,resizable=no,status=no,directories=no,toolbar=no');
}