//JScript
//Version 1.0
//Excite 2008

function WindowPopUp(_strPageUrl, _strName, _intWidth, _intHeight )
{
	window.open(_strPageUrl,_strName,"width=" + _intWidth + ",height=" + _intHeight + ",toolbar=0,titlebar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1");
}
function WindowPopUpMore(_strPageUrl,_strName,_intWidth,_intHeight,_intToolBar,_intTitleBar,_intLocation,_intDirectories,_intStatus,_intMenuBar,_intScrollBars,_intResizeable)
{
	window.open(_strPageUrl,_strName,"width=" + _intWidth + ",height=" + _intHeight + ",toolbar=" + _intToolBar + ",titlebar=" + _intTitleBar + ",location=" + _intLocation + ",directories=" + _intDirectories + ",status=" + _intStatus + ",menubar=" + _intMenuBar + ",scrollbars=" + _intScrollBars + ",resizable=" + _intResizeable);
}
function ExpandBlock(id)
{
	if (document.getElementById(id).style.display == 'block')
  		{
  			document.getElementById(id).style.display = 'none';
  		}
  		else
  		{
  			document.getElementById(id).style.display = 'block';
   		}
}
function MakeEmail(EmailName, Domain)
{
   document.write("<a href=\"mailto:" + EmailName + "&#64;" + Domain + "\">" + EmailName + "&#64;" + Domain + "</a>");
}
function MakeEmailUseCSS(EmailName, Domain, CSSClass)
{
   document.write("<a class=\"" + CSSClass + "\" href=\"mailto:" + EmailName + "&#64;" + Domain + "\">" + EmailName + "&#64;" + Domain + "</a>");
}


function highlightPromo(obj, doHilite, PromoInfoBox, PromoInfoBoxSpcr, HiliteClass, NoHiliteClass) {

    if (doHilite) {
        obj.className = HiliteClass;
        document.getElementById(PromoInfoBox).style.display = 'block';
        document.getElementById(PromoInfoBoxSpcr).style.display = 'none';
    }
    else {
        obj.className = NoHiliteClass;
        document.getElementById(PromoInfoBox).style.display = 'none';
        document.getElementById(PromoInfoBoxSpcr).style.display = 'block';
    }
}

function promoBorderOff(promoBorderedDiv, CssClassId) {
        document.getElementById(promoBorderedDiv).className = CssClassId;
}

function highlightLineagePromo(obj, doHilite, PromoInfoBoxId) {

    if (doHilite) {
        obj.className = "promoLineageDivHilite";
        document.getElementById(PromoInfoBoxId).style.display = 'block';
    }
    else {
        obj.className = "promoLineageDiv";
        document.getElementById(PromoInfoBoxId).style.display = 'none';
    }
}

function highlightLineagePromo1(obj, doHilite, PromoInfoBoxId) {

    if (doHilite) {
        obj.className = "promoLineageDivHilite";
        //document.getElementById(PromoInfoBoxId).style.display = 'block';
    }
    else {
        obj.className = "promoLineageDiv1";
        //document.getElementById(PromoInfoBoxId).style.display = 'none';
    }
}


function highlightMapListPromo(obj, doHilite, PromoInfoBoxId) {

    if (doHilite) {
        obj.className = "promoMapListDivHilite";
        //document.getElementById(PromoInfoBoxId).style.display = 'block';
    }
    else {
        obj.className = "promoMapListDiv1";
        //document.getElementById(PromoInfoBoxId).style.display = 'none';
    }
}

function doSearchHighlight(obj, doHilite, HiliteClass, NoHiliteClass) {

    if (doHilite) {
        obj.className = HiliteClass;
        document.getElementById('SearchChkBx').style.display = 'block';
    }
    else {
        obj.className = NoHiliteClass;
        document.getElementById('SearchChkBx').style.display = 'none';
    }
}

function plannerTree_onClientNodeCollapsed(sender, args) {
    UpdatePlannerTreeData.CollapseNode(args.get_node().get_value());
}


function plannerTree_onClientNodeExpanded(sender, args) {
    UpdatePlannerTreeData.ExpandNode(args.get_node().get_value());
}

function doHighlight(obj, CssClass) {
    obj.className = CssClass;
}

function doScrollPosn() {
    window.scrollBy(0, 500);
}

function doScrollPosnByX(ByX) {
    window.scrollBy(0, ByX);
}

function doClick(PromoId,SrchTyp,CatkeyId) {
    ClickGoToUrl.DoClick(PromoId, SrchTyp, CatkeyId);
}

//Used for promo list
function itemDraggingMap() {
    document.getElementById('DivMyPlannerHdr').scrollIntoView();
    document.getElementById('MapPlannerZoomTo').scrollIntoView();
    
}

//Used for promo list
function itemDragging() {
    if (getScrollY() > 400) {
        document.getElementById('plannerDropZone').scrollIntoView();
        document.getElementById('MapPlannerZoomTo').scrollIntoView();
    }
}

function getScrollY() {
    var scrOfY = 0;
    if (typeof (window.pageYOffset) == 'number') {
        scrOfY = window.pageYOffset;
    } else if (document.body && document.body.scrollTop) {
        scrOfY = document.body.scrollTop;
    } else if (document.documentElement && document.documentElement.scrollTop) {
        scrOfY = document.documentElement.scrollTop;
    }
    return scrOfY;
}
//Used for promo list
function checkMousePosn(e, handler) {
    if (e.type != 'mouseout' && e.type != 'mouseover') return false;
    var reltg = e.relatedTarget ? e.relatedTarget :
	e.type == 'mouseout' ? e.toElement : e.fromElement;
    while (reltg && reltg != handler) reltg = reltg.parentNode;
    return (reltg != handler);
}
