﻿// JScript File

function Back()
{
    history.back(-1);
}

/* send to friend */
function ebc(mode)
{
    if(document.getElementById("F1") != null)
    {
        if(mode) document.getElementById("F1").style.position = 'static';
        else document.getElementById("F1").style.position = 'relative';
    }
}
function email(obj)
{
   ebc(true); 

   var cLeft = getposOffset(document.getElementById('lnkEmail'),"left");
   var cTop = getposOffset(document.getElementById('lnkEmail'),"top");
   
   document.getElementById('dvSend').style.left = (cLeft -120) + "px";
   document.getElementById('dvSend').style.top = (cTop + 17 ) + "px";
   document.getElementById('dvSend').style.display = "block";
   
    if(document.getElementById('imgGalFlash')!=null)
   {
     document.getElementById('imgGalFlash').style.display='none';
   }
}

function eclose()
{
   ebc(false); 
   document.getElementById('dvSend').style.display = "none";
   
    if(document.getElementById('imgGalFlash')!=null)
   {
     document.getElementById('imgGalFlash').style.display='block';
   }
}

function getposOffset(what, offsettype)
{
    var totaloffset=(offsettype=="right")? what.offsetLeft : what.offsetTop;
    var parentEl=what.offsetParent;
    while (parentEl!=null)
    {
        totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
        parentEl=parentEl.offsetParent;
    }
    return totaloffset;
}

/* Send To friend end */

/* Video player for news related videos starts form here */
function Ovideo() {
    document.getElementById('main1').style.display = 'block';
    document.getElementById('nxt').style.display = 'block';
}
function Cvideo() {
    document.getElementById('main1').style.display = 'none';
    document.getElementById('nxt').style.display = 'none';
    var player = document.getElementById('flvPlayer');
    player.innerHTML = '';
}

/* New Video Gallery */
function PlayMovie1(filename) {
    Ovideo();
    var player = document.getElementById('flvPlayer');
    player.innerHTML = "<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' width='387' height='302' bgcolor='#000000' id='myFlashMovie' name='myFlashMovie'><param name='movie' value='" + AppPath + "_resources/Global/player/zoom.swf' /><param name='FlashVars' value='videos=" + filename + "&fms=&app=' /><param name='allowFullScreen' value='true' /><param name='quality' value='high'/><embed src='" + AppPath + "_resources/Global/player/zoom.swf' width='387' height='302' bgcolor='#000000' flashvars='videos=" + filename + "&fms=&app=' allowfullscreen='true' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer'  id='myFlashMovie' name='myFlashMovie'/></object>";
    }
/* Video player for news related videos ends here */
function fixScroll() {
    //document.getElementById('main1').style.height = document.getElementById('tblContent').offsetHeight;
    document.getElementById('main1').style.width = screen.width - 23;
    var lPos = (screen.width) ? (screen.width - 300) / 2 : 0;
    document.getElementById('nxt').style.left = lPos + 'px';
    var tPos = (screen.availHeight) ? (screen.availHeight - 440) / 2 : 0;
    document.getElementById('nxt').style.top = tPos + 'px';


    var cleft = 0;
    var cTop = 0;
    var obj = document.getElementById('tdContent');
    if (obj != null) {
        if (obj.offsetParent) {

            while (true) {
                cleft += obj.offsetLeft;
                cTop += obj.offsetTop;
                if (!obj.offsetParent) break;
                obj = obj.offsetParent;
            }
        }
    }
}

/* --- Search start ---*/
function cSearch()
{
    if(document.getElementById(tSearch).value == 'Enter the Keyword')
    document.getElementById(tSearch).value = '';
}

function rSearch()
{
    if(document.getElementById(tSearch).value == '')
    document.getElementById(tSearch).value = 'Enter the Keyword';
}
function checksearch(oSrc, args)
{
    if(document.getElementById(tSearch).value == 'Enter the Keyword')
    {
        document.getElementById(tSearch).value = '';
        args.IsValid = false;
    }
    else 
    {
        args.IsValid = true;
    }
}
/* ---- Search End ----*/ 