﻿// JScript File

function openMenu(divName)
{
    var div = document.getElementById(divName);
    if (div != null)
    {
        div.style.display = "block";
    }
}
function closeMenu(divName)
{
    var div = document.getElementById(divName);
    if (div != null)
    {
        div.style.display = "none";
    }
}
/*
function popUp(url)
{
    //popUp(url, 600, 900);
    return popUp(url, false);
}*/
function popUp(url, isVertical)
{
    if (isVertical == true || isVertical == "true")
    {
        return popUp2(url, 670, 530);
    }
    else
    {
        return popUp2(url, 800, 425);
    }
}

function popUp2(url, width, height)
{
    //popup = window.open(url, 'popup', 'toolbar=no,directories=no,scrollbars=no,width='+width+',height='+height);
    popup = window.open(url, 'popup', "toolbar=no,directories=no,scrollbars=no,width="+width+",height="+height);
    popup.focus();
    return false;
    /*return true;*/
}
function popUpWithPicWidth(url, width, height)
{
    //width = width + 345; // 356
    //height = height + 71; // 44
    var h = height;
    if(height < 364) h = 364;
    if(width > height)
    {
        //return popUp(url, false);
        return popUp2(url, 800, h+64);
    }
    else
    {   
        //return popUp(url, true);
        return popUp2(url, 670, h+64);
    }
}
function popUptoHome(url)
{
    if (window.opener != null)
    {
        window.opener.location = url;
        window.close();
        return false;
    }
    else
    {
        window.open(url, '_blank');
        window.close();
        return false;
    }
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function ripTag2(txtBoxName){
    var search = document.getElementById(txtBoxName);
    if (search != null)
    {
        search.value = search.value.replace(/[<>]/g, "");
    }
    return true;
}
