﻿// JScript File


function popitup(url, height, width, name)
{
   var x = (640 - width)/2, y = (480 - height)/2;

    if (screen) {
        y = (screen.availHeight - height)/2;
        x = (screen.availWidth - width)/2;
    }
    
    var newwindow=window.open(url,name,'height=' + height + ',width=' + width + ',screenX=' + x + ',screenY=' + y + ',top='+y+',left='+x + ',menubar=no,location=no,status=no,toolbar=no,resizable=yes,scrollbars=yes');
	if (window.focus) 
	{
	if (newwindow != null)
	newwindow.focus();
	}
	return false;
}

function popitupScroll(url, height, width, name, scroll)
{
    var x = (640 - width)/2, y = (480 - height)/2;

    if (screen) {
        y = (screen.availHeight - height)/2;
        x = (screen.availWidth - width)/2;
    }
    
    var newwindow=window.open(url,name,'height=' + height + ',width=' + width + ',screenX=' + x + ',screenY=' + y + ',top='+y+',left='+x + ',menubar=no,location=no,status=no,toolbar=no,resizable=yes,scrollbars=' + scroll );
	if (window.focus) 
	{
	if (newwindow != null)
	newwindow.focus();
	}
	return false;
}

function popitupnoscroll(url, height, width, name)
{
    var x = (640 - width)/2, y = (480 - height)/2;

    if (screen) {
        y = (screen.availHeight - height)/2;
        x = (screen.availWidth - width)/2;
    }
    
    var newwindow=window.open(url,name,'height=' + height + ',width=' + width + ',screenX=' + x + ',screenY=' + y + ',top='+y+',left='+x + ',menubar=no,location=no,status=no,toolbar=no,resizable=yes,scrollbars=no');
	if (window.focus) 
	{
	if (newwindow != null)
	newwindow.focus();
	}
	return false;
}

function popitupmenu(url, height, width, name)
{
    var x = (640 - width)/2, y = (480 - height)/2;

    if (screen) {
        y = (screen.availHeight - height)/2;
        x = (screen.availWidth - width)/2;
    }
    
    var newwindow=window.open(url,name,'height=' + height + ',width=' + width + ',screenX=' + x + ',screenY=' + y + ',top='+y+',left='+x + ',menubar=yes,location=yes,status=no,toolbar=yes,resizable=yes,scrollbars=yes');
	if (window.focus) 
	{
	if (newwindow != null)
	newwindow.focus();
	}
	return false;
}

function order(MediaItemID, ProductType, usertype)
{
    if(usertype == "sea")
        popitup('broadcastOrder.aspx?MediaItemID=' + MediaItemID + '&ProductType=' + ProductType, 560, 600, 'Order');
    else
        popitup('broadcastOrder.aspx?MediaItemID=' + MediaItemID + '&ProductType=' + ProductType, 620, 600, 'Order');
}

function pressOrder(MediaItemID, ProductType)
{
    popitup('pressOrder.aspx?MediaItemID=' + MediaItemID + '&ProductType=' + ProductType, 490, 600, 'Order');
}

function onOrder ()
{
    popitup('message.aspx?Message=OnOrder', 100, 300, 'Message');        
}

function offsiteOrder ()
{
    popitup('message.aspx?Message=OrderOffsite', 100, 300, 'Message');        
}

function getTranscript(OrderID)
{
    popitupmenu('getTranscript.aspx?OrderID=' + OrderID, 580, 780, 'Transcript');
}       

function getOrder(OrderID,FileSize,ProductType)
{
    popitup('getOrder.aspx?OrderID=' + OrderID + '&FileSize=' + FileSize + '&ProductType=' + ProductType, 230, 380, 'GetOrder');
}      

function actionOrder(OrderID)
{
    popitup('actionOrder.aspx?OrderID=' + OrderID, 468, 550, 'actionOrder');
}   

function getClip(MediaItemID,ClipRef,ProspectID)
{
    popitup('getClip.aspx?MediaItemID=' + MediaItemID + '&clipRef=' + ClipRef, 580, 780, 'Clip');
}

function getOCR(MediaItemID)
{
    popitup('getOCR.aspx?MediaItemID=' + MediaItemID, 580, 600, 'Text');
}

function emailClip(MediaItemID)
{
    popitup('emailClip.aspx?MediaItemID=' + MediaItemID, 310, 400, 'EmailClip');
} 

function emailClipProsp(ProspectID)
{
    popitup('emailClip.aspx?ProspectID=' + ProspectID, 380, 500, 'EmailClip');
} 

function updatePosition(PositionID)
{
    popitup('notifyUpdate.aspx?PositionID=' + PositionID, 320, 500, 'notifyUpdate');
} 

function clipLocked()
{
  popitup('message.aspx?Message=Locked', 130, 300, 'Message');
}

function copyrightExpired(countryExpiry)
{
  popitup('message.aspx?Message=CopyrightExpired' + countryExpiry, 130, 300, 'Message');
}

function replaceAll( str, from, to ) 
{
    var idx = str.indexOf( from );

    while ( idx > -1 ) 
    {
        str = str.replace( from, to ); 
        idx = str.indexOf( from );
    }

    return str;
}

function SetCookie(cookieName,cookieValue,nDays) 
{
 var today = new Date();
 var expire = new Date();
 if (nDays==null || nDays==0) nDays=1;
 expire.setTime(today.getTime() + 3600000*24*nDays);
 document.cookie = cookieName + "=" + cookieValue + ";expires=" + expire.toGMTString() + ";path=/";
}

function GetCookie(cookieName) 
{
 var theCookie = "" + document.cookie;
 var ind = theCookie.indexOf(cookieName);
 if (ind==-1 || cookieName=="") return ""; 
 var ind1 = theCookie.indexOf(';',ind);
 if (ind1==-1) ind1 = theCookie.length; 
 return unescape(theCookie.substring(ind+cookieName.length+1,ind1));
}

function gup( name )
{
  var regexS = "[\\?&]"+name+"=([^&#]*)";
  var regex = new RegExp( regexS );
  var tmpURL = window.location.href;
  var results = regex.exec( tmpURL );
  if( results == null )
    return "";
  else
    return results[1];
}


function FindElementByIdTag(id, tag)
{
    var i, tempid;
    var obj, col, found = false;
    obj = document.getElementById(id);
    if(obj != null)
        return(obj);
    
    if(tag == null)
        return(null);
    
    col = document.getElementsByTagName(tag);
    
    obj = null;
    for(i=0; i < col.length; i++)
    {
        tempid = col[i].id;
        tempid = tempid.substr(tempid.lastIndexOf('_') + 1);
        if(tempid == id)
            obj = col[i];
    }
    return(obj);
}

function ShowCommentsTable(tablename)
{
    if(tablename == "")
        return;
    var LoadingTable = FindElementByIdTag(tablename, 'table');
    if(LoadingTable != null)
    {
        if(LoadingTable.style.visibility == 'hidden')
        {
            LoadingTable.style.display = '';
            LoadingTable.style.visibility = 'visible';
            LoadingTable.scrollIntoView(true);
        }
        else
        {
            LoadingTable.style.display = 'none';
            LoadingTable.style.visibility = 'hidden';    
        }
    }
}


function AddComment(prospectID)
{
    var inputtext = FindElementByIdTag('CommentInput' + prospectID, 'textarea');
    inputtext.value = "";
    var editcommentiddiv = FindElementByIdTag('editcommentiddiv', 'div');
    editcommentiddiv.innerHTML = "";
    var editadddiv = FindElementByIdTag('editadddiv' + prospectID, 'div');
    editadddiv.innerHTML = "New comment:";
    ShowCommentsTable('AddCommentsTable' + prospectID);        
}

function QuoteComment(prospectID, commentID, username, datemodified)
{
    var editcommentiddiv = FindElementByIdTag('editcommentiddiv', 'div');
    editcommentiddiv.innerHTML = "";
    var editadddiv = FindElementByIdTag('editadddiv' + prospectID, 'div');
    editadddiv.innerHTML = "New comment:";
    var inputtext = FindElementByIdTag('CommentInput' + prospectID, 'textarea');
    var commentdiv = FindElementByIdTag('usercomment' + commentID, 'div');
    var comment = commentdiv.innerHTML;
    //alert(comment);
    while (comment.indexOf("<br>") > -1)
    {
        comment = comment.replace("<br>","\n");
    }
    while (comment.indexOf("<BR>") > -1)
    {
        comment = comment.replace("<BR>","\n");
    }
    while (comment.indexOf("\r\n") > -1)
    {
        comment = comment.replace("\r\n",""); // Check uppercase for IE
    }
    while (comment.indexOf("\R\N") > -1)
    {
        comment = comment.replace("\R\N",""); // Check uppercase for IE
    }
    while (comment.indexOf("<b>") > -1)
    {
        comment = comment.replace("<b>","");
    }
    while (comment.indexOf("</b>") > -1)
    {
        comment = comment.replace("</b>","");
    }
    /*
    while (comment.indexOf("<strong>","[comment]") > -1)
    {
        comment = comment.replace("<strong>","[comment]");
    }
    while (comment.indexOf("</strong>") > -1)
    {
        comment = comment.replace("</strong>","\"]");
    }*/
    while (comment.indexOf("<table class=\"quoteTable\"><tbody><tr><td>") > -1)
    {
        comment = comment.replace("<table class=\"quoteTable\"><tbody><tr><td>","In reply to ");
    }
    while (comment.indexOf("<TABLE class=quoteTable><TBODY><TR><TD>") > -1)
    {
        comment = comment.replace("<TABLE class=quoteTable><TBODY><TR><TD>","In reply to ");
    }
    while (comment.indexOf("<table class=quoteTable><tbody><tr><td>") > -1)
    {
        comment = comment.replace("<table class=quoteTable><tbody><tr><td>","In reply to ");
    }
    while (comment.indexOf("</td></tr></tbody></table>") > -1)
    {
        comment = comment.replace("</td></tr></tbody></table>","");
    }
    while (comment.indexOf("</TD></TR></TBODY></TABLE>") > -1)
    {
        comment = comment.replace("</TD></TR></TBODY></TABLE>","");
    }
    //keep only one last comment
     while ( (comment.indexOf("In reply to ") > -1) && (comment.indexOf(").") > -1))
    {
    
        var ioldQuote = comment.indexOf("). \n\n");
        if (ioldQuote==-1)
        {
            ioldQuote=comment.indexOf(").");
                if (ioldQuote >-1)
                {
                ioldQuote =ioldQuote+4;
                }
        }
        else
        {
        ioldQuote= ioldQuote+5;
        }
        
        
       
        comment = comment.substring(ioldQuote,comment.length);
    } 
    
    
    inputtext.value = "In reply to " + comment + "\n" + "(" + username + ", " + datemodified + ")." + "\n" + "\n";
    ShowCommentsTable('AddCommentsTable' + prospectID);
        
}

function EditComment(prospectID, commentID, commentuserID, currentuserID)
{
    if(commentuserID != currentuserID)
    {
        popitup('message.aspx?Message=EditCommentError', 110, 300, 'Message');
    }
    else
    {
        var editcommentiddiv = FindElementByIdTag('editcommentiddiv', 'div');
        editcommentiddiv.innerHTML = commentID;
        var editadddiv = FindElementByIdTag('editadddiv' + prospectID, 'div');
        editadddiv.innerHTML = "Edit Comment:";    
        var inputtext = FindElementByIdTag('CommentInput' + prospectID, 'textarea');
        var commentdiv = FindElementByIdTag('usercomment' + commentID, 'div');
        var comment = commentdiv.innerHTML;
        var commenttemp = comment.toLowerCase();
        while (comment.indexOf("<b>") > -1)
        {
            comment = comment.replace("<b>","");
            comment = comment.replace("<B>","");
            commenttemp = commenttemp.replace("<b>","");
        }
        while (comment.indexOf("</b>") > -1)
        {
            comment = comment.replace("</b>","");
            comment = comment.replace("</B>","");
            commenttemp = commenttemp.replace("</b>","");
        }
        while (commenttemp.indexOf("\r\n") > -1)
        {
            comment = comment.replace("\r\n","");
            comment = comment.replace("\R\N",""); // Check uppercase for IE
            commenttemp = commenttemp.replace("\r\n",""); // Check uppercase for IE
        }
        while (commenttemp.indexOf("<br>") > -1)
        {
            comment = comment.replace("<br>","\n");
            comment = comment.replace("<BR>","\n");
            commenttemp = commenttemp.replace("<br>","\n");
        }
        while (commenttemp.indexOf("<table class=\"quotetable\"><tbody><tr><td>","In reply to ") > -1)
        {
            comment = comment.replace("<table class=\"quoteTable\"><tbody><tr><td>","In reply to ");
            comment = comment.replace("<TABLE class=\"quoteTable\"><TBODY><TR><TD>","In reply to ");
            commenttemp = commenttemp.replace("<table class=\"quotetable\"><tbody><tr><td>","In reply to ");
        }
        while (commenttemp.indexOf("<table class=quotetable><tbody><tr><td>","In reply to ") > -1)
        {
            comment = comment.replace("<table class=quoteTable><tbody><tr><td>","In reply to ");
            comment = comment.replace("<TABLE class=quoteTable><TBODY><TR><TD>","In reply to ");
            commenttemp = commenttemp.replace("<table class=quotetable><tbody><tr><td>","In reply to ");
        }
        while (commenttemp.indexOf("</strong>") > -1)
        {
            comment = comment.replace("</strong>","\"]");
            comment = comment.replace("</STRONG>","\"]");
            commenttemp = commenttemp.replace("</strong>","\"]");
        }        
        while (commenttemp.indexOf("<table style=\"border-right: darkgray 1px solid; border-top: darkgray 1px solid; border-left: darkgray 1px solid; border-bottom: darkgray 1px solid\"><tbody><tr><td>") > -1)
        {
            comment = comment.replace("<table style=\"border-right: darkgray 1px solid; border-top: darkgray 1px solid; border-left: darkgray 1px solid; border-bottom: darkgray 1px solid\"><tbody><tr><td>","");
            comment = comment.replace("<TABLE style=\"BORDER-RIGHT: darkgray 1px solid; BORDER-TOP: darkgray 1px solid; BORDER-LEFT: darkgray 1px solid; BORDER-BOTTOM: darkgray 1px solid\"><TBODY><TR><TD>","");
            commenttemp = commenttemp.replace("<table style=\"border-right: darkgray 1px solid; border-top: darkgray 1px solid; border-left: darkgray 1px solid; border-bottom: darkgray 1px solid\"><tbody><tr><td>","");
        }
        while (commenttemp.indexOf("<table style=\"border: 1px solid darkgray;\"><tbody><tr><td>") > -1)
        {
            comment = comment.replace("<table style=\"border: 1px solid darkgray;\"><tbody><tr><td>","");
            comment = comment.replace("<TABLE style=\"BORDER: 1px solid darkgray;\"><TBODY><TR><TD>","");
            commenttemp = commenttemp.replace("<table style=\"border: 1px solid darkgray;\"><tbody><tr><td>","");
            
        }
        while (commenttemp.indexOf("</td></tr></tbody></table>") > -1)
        {
            comment = comment.replace("</td></tr></tbody></table>","");
            comment = comment.replace("</TD></TR></TBODY></TABLE>","");
            commenttemp = commenttemp.replace("</td></tr></tbody></table>","");
        }
        inputtext.value = comment;
        ShowCommentsTable('AddCommentsTable' + prospectID);
    }
        
}

function showDetail(oRow)
{
    if(ctl00_ph1_Grid1.Data[oRow.Index][1] == "read" || ctl00_ph1_Grid1.Data[oRow.Index][1] == "unread")
    {
        if(ctl00_ph1_Grid1.Data[oRow.Index][1] != "report item" && (ReadOnViewClip == 0 || (ReadOnViewClip == 1 && oRow.GetMember("SourceSystem").Text != "Press")))
        {
            oRow.SetValue(1, 'read', false);
            ctl00_ph1_Grid1.Render();	        
        }
    }
    ctl00_ph1_CallBack_PreviewPane.Callback(oRow.GetMember("ProspectID").Text);
    
    return true;
}


function GotoPagePosition()
{
    var view = GetCookie('mpview1');
    if(view != null && view == "Classic")
    {
        sstchur_SmartScroller_GetCoords();
        window.location.reload();
    }
    else
    {
        var gridItem = ctl00_ph1_Grid1.GetSelectedItems();
        
        if(gridItem[0] != null)
        {
            showDetail(gridItem[0]);
        }
    }
}

function sstchur_SmartScroller_GetCoords()
{
     var scrollX, scrollY;
  
    
     if(document.getElementById('divClassic').style.height == 'auto')
     {
        if (document.all)
        {           
             if (!document.documentElement.scrollTop)
                scrollY = document.body.scrollTop;
             else
                scrollY = document.documentElement.scrollTop;
        }
        else
        {
            scrollY = window.pageYOffset;
        }
     }
     else
     {
        scrollY = document.getElementById("divClassic").scrollTop;
     }

     document.cookie = 'scrollTop=' + scrollY
}

function sstchur_SmartScroller_Scroll()
{
    if(view == "Classic")
    {
        var y = GetCookie('scrollTop');
        var commtable = GetCookie('OpenComments');
        if(document.getElementById('divClassic').style.height == 'auto')
        {
            window.scrollTo(0, y);
        }
        else
        {
            document.getElementById("divClassic").scrollTop = y;
            document.getElementById("divClassic").scrollTop = y;
        }
        document.cookie = 'scrollTop='
        //ShowCommentsTable(commtable);
    }
    
}

function AddCommentsScript(prospectID,delivesetID,mediaitemID)
{
    var editadddiv = FindElementByIdTag('editadddiv' + prospectID, 'div');
    var editaddlabel = editadddiv.innerHTML;
    var commentstextbox = FindElementByIdTag('CommentInput' + prospectID, 'text')
    if(commentstextbox.value == "")
    {
         popitup('message.aspx?Message=EmptyCommentError', 110, 300, 'Message');
    }
    else
    {    
        SetCookie('OpenComments', "CommentsTable" + prospectID, 1000);
        if(editaddlabel == "New comment:")
        {
            ctl00_ph1_CallBack_AddComment.Callback(prospectID,"-1",delivesetID,mediaitemID,commentstextbox.value,document.location.href);        
        }
        else
        {
            var editcommentiddiv = FindElementByIdTag('editcommentiddiv', 'div');
            var commentID = editcommentiddiv.innerHTML;
            ctl00_ph1_CallBack_AddComment.Callback(prospectID,commentID,delivesetID,mediaitemID,commentstextbox.value,document.location.href);        
        }
        //ShowCommentsTable("CommentsTable" + prospectID);
    }
    
}

function DeleteCommentsScript(prospectID,commentID)
{
    var doIt=confirm('Are you sure you want to delete your comment?');
    
    if(doIt)
    {    
       SetCookie('OpenComments', "CommentsTable" + prospectID, 1000);
 
       ctl00_ph1_CallBack_AddComment.Callback(prospectID,commentID,0,0,"",document.location.href);        
    }
    
}

function ErrorAddComment()
{
    popitup('message.aspx?Message=CommentError', 110, 300, 'Message');   
}

function ShowItemHistory(UserID,ProspectID)
{
    popitup('History.aspx?UserID=' + UserID + '&prosID=' + ProspectID, 200, 500, 'Text');
}

function stream(SummaryID)
{
    popitupnoscroll('WSHub_pop.aspx?ProspectID=' + SummaryID, 680, 1040, 'Stream');
} 

function myMediaStream()
{
    popitupnoscroll('WSHub_pop.aspx', 680, 1040, 'Stream');
} 

function confirmCharge()
{
    //alert(document.getElementById("btnConfirm").style.Visiblity);
    document.getElementById("divConfirmation").style.display = 'none';
    document.getElementById("loader").style.display = 'block';
    setTimeout('document.getElementById("loaderimg").src = "images/building_report.gif"', 200);         
}

function HiglightSelectItem(itemID)
{
    it = document.getElementById(itemID);
    it.style.background = '#E2ECF5';
    it.style.border = '1px solid #0F73BE';
}

function UnHiglightSelectItem(itemID)
{
    it = document.getElementById(itemID);
    it.style.border = 'none';

    it.style.padding = '5px';
    it.style.width = '265px';
    it.style.borderBottom = '1px solid #C0CAD4';
    it.style.background = 'none';    
}

function processing()
{
    document.getElementById("divRunning").style.display = 'block';
    setTimeout('document.getElementById("imgRunning").src = "images/spinner1.gif"', 200);  
     document.getElementById("btnConfirm").style.display = 'none';
    //btnConfirm
    return true ;
}

function tabClick(show,pageone)
{
            //document.getElementById('lnkbutPrev').className = "pagingDisabled";
            //document.getElementById('lnkbutNext').className = "pagingEnabled";
            
            
                    
            if(show == 'all') 
            {
                document.getElementById('tabAll').className = 'tabAll_on';
                document.getElementById('tabVideo').className = 'tabVideo_off';
                document.getElementById('tabAudio').className = 'tabAudio_off';
                //window.location = "WSHub_pop.aspx?selectplaylist=all";
            }
            else if(show == 'video')
            {
                document.getElementById('tabAll').className = 'tabAll_off';
                document.getElementById('tabVideo').className = 'tabVideo_on';
                document.getElementById('tabAudio').className = 'tabAudio_off';
                //window.location = "WSHub_pop.aspx?selectplaylist=video";
            }
            else if(show == 'audio')
            {
                document.getElementById('tabAll').className = 'tabAll_off';
                document.getElementById('tabVideo').className = 'tabVideo_off';
                document.getElementById('tabAudio').className = 'tabAudio_on';
                //window.location = "WSHub_pop.aspx?selectplaylist=audio";
            }
            CallBack1.callback(show,pageone);
}


function pagingBut(prevornext)
{
    /*
    var startpage = GetCookie('PlayListPage');
    var endpage = GetCookie('PlayListPageMax');
    
    if(startpage == null)
    {
        startpage = 1;
        endpage = 15;
    }
    
    var dp = FindElementByIdTag('divPagenum', 'span');
    dp.innerHTML = startpage + " - " + endpage; */
        
    if(document.getElementById('tabVideo').className == 'tabVideo_on')
    {
        CallBack1.callback('video',prevornext);    
    }
    else if(document.getElementById('tabAudio').className == 'tabAudio_on')
    {
        CallBack1.callback('audio',prevornext);
    }
    else
    {
        CallBack1.callback('all',prevornext);
    }
    
    /*
    //alert('ee');
    var txtPageInfo = FindElementByIdTag('txtPageInfo', 'TextBox');
    var disbuttons = txtPageInfo.value;   
    //alert(disbuttons);
    if(disbuttons == 'prev')
    {
        document.getElementById('lnkbutPrev').className = "pagingDisabled";
        document.getElementById('lnkbutNext').className = "pagingEnabled";
        //alert('p');
    }
    else if(disbuttons == 'next')
    {
        document.getElementById('lnkbutNext').className = "pagingDisabled";
        document.getElementById('lnkbutPrev').className = "pagingEnabled";
        //alert('n');
    }
    else if(disbuttons == 'prevnext')
    {
        document.getElementById('lnkbutPrev').className = "pagingDisabled";
        document.getElementById('lnkbutNext').className = "pagingDisabled";
        //alert('b');
    }
    else
    {
        document.getElementById('lnkbutPrev').className = "pagingEnabled";
        document.getElementById('lnkbutNext').className = "pagingEnabled";
        //alert('o');
    }*/
      
}
     
function CheckItemsSelected()
{
    var itemselected = GetCookie('reportitemssel');
    if(itemselected != "")
    {
        window.location = "monitor_reports.aspx";
    }
    else
    {
        var currenturl = window.location.href;
        if(currenturl.indexOf("newsfeedcontent.aspx") != -1)
        {
            popitup('message.aspx?Message=NoItemsForReport2', 115, 300, 'Message');
        }
        else
        {
            popitup('message.aspx?Message=NoItemsForReport1', 128, 300, 'Message');
        }
    }
} 


function ShowSpan(spanId,hypId)
{

 //var ctlToggle = document.getElementById(hypId);
    if(spanId == "")
        return;
    var LoadingSpan = FindElementByIdTag(spanId, 'span');
    if(LoadingSpan != null)
    {
        if(LoadingSpan.style.visibility == 'hidden')
        {
            LoadingSpan.style.display = '';
            LoadingSpan.style.visibility = 'visible';
            hypId.innerHTML="Hide...";
        }
        else
        {
            LoadingSpan.style.display = 'none';
            LoadingSpan.style.visibility = 'hidden';    
            hypId.innerHTML="More...";

        }
    }
}


function CheckIfRedirect()
{
    var txtcamp = FindElementByIdTag('txtCampaignName', 'TextBox');
    var campID = txtcamp.value;   
    if((campID != "") && (campID.length > 12))
    {
        var temp = campID.substring(0,12);
        if(temp == "?CampaignID=")
        {
            window.opener.window.location  = 'AddRelease_Step1.aspx';
            window.close();
        }
    }
}


function CheckIfSaved()
{
    var txtLit = FindElementByIdTag('txtDetails', 'TextBox');
    var campID = txtLit.value;   
    if(campID == "SaveClicked")
    {
        window.opener.window.location.reload();;
        window.close();
    }
    
    var radiobtnRss = document.getElementById('No');
     if (radiobtnRss && radiobtnRss.checked)
        {
        	   var style = document.getElementById('divRSSDays').style; 
		        style.display = "none"; 
        }

}
        
        /* export functionality*/
//function checkExportasrcombo(me)
//{
//if ((document.getElementById("ddlCurrency"))&&(document.getElementById("ddlCurrency").value == "0"))
//	{
//	document.getElementById("spanError").style.display = "inline";
//	return false;
//	}
//	else
//	{
//	document.getElementById("spanError").style.display = "none";
//	return true;
//	}
//}

//var exportTimer;
//function processexport()
//{
//    document.getElementById("divRunning").style.display = 'block';
//    exportTimer=setTimeout('document.getElementById("imgRunning").src = "images/spinner1.gif"', 200);  
//    return true ;
//}
//function finishexport()
//{
//clearTimeout(exportTimer);
//alert("finished");
////    document.getElementById("divRunning").style.display = 'none';
////    setTimeout('document.getElementById("imgRunning").src = "images/blank.gif"', 200);  
//    return true ;
//}
