﻿var greturnfuncion = null;
var popcont;
var strImgCloseBtnPath = "../images/popup/popUpCloseBtn.gif";
var strImgPopupstickleft = "../images/popup/popUpBotStickLeft.gif";
var strImgPopupstickright = "../images/popup/popUpBotStickRight.gif";

function initCommentUp(title,url,funname)
{   
    greturnfuncion = funname;	
	theBody = self.document.getElementsByTagName('BODY')[0];
	popcont = self.document.createElement('div');
	popcont.style.cssText = "visibility:hidden;left:120px;margin-left:5%;position:absolute;width:565px;top:250px;z-index:2;";
	popcont.id = 'popupContainer1';    
    var strTable = "<table width=\"100%\" height=\"250px\" border='0' cellpadding=\"0\" cellspacing=\"0\" style=\"border:#CCC solid 1px;border-bottom:none;\">";
    strTable += "<tr><td>";
    strTable += "<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" class=\"popUpTitleBg\">";
    strTable += "<tr>";
    strTable += "<td width=\"96%\" style='padding-left:5px;'>"+ title +"</td>";
    strTable += "<td width='4%' align='left'>";
    strTable += "<img src="+strImgCloseBtnPath+" alt='' width='13' height='13' onclick='doCloseComment(0);' title='close'>";
    strTable += "</td>";
    strTable += "</tr></table></td></tr>";
    
    strTable += "<tr><td class=\"popUpBgColor\">";    
    strTable += "<iframe id=\"ifrmComposeMail\" src =\"" + url +"\" frameborder=\"0\" scrolling=\"no\" style=\"width:570px;height:312px;border:1;\" align='center'></iframe>";    
    strTable +="</td>";
    strTable += "</tr><tr>";
    strTable += "<td style=\"padding-top:2px;\" class=\"popUpBgColor\">";
    strTable += "<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" class=\"popUpBgColor\">";
    strTable += "<tr><td align=\"left\" valign=\"top\">";
    strTable += "<img src="+strImgPopupstickleft+" width='179' height='5'/>";
    strTable += "</td>";
    strTable += "<td align=\"right\" valign=\"top\">";
    strTable += "<img src="+strImgPopupstickright+" width='179' height='5'/>";
    strTable += "</td>";
    strTable += "</tr></table></td></tr></table>";
    popcont.innerHTML = strTable;    
	theBody.appendChild(popcont);
	setVisible('popupContainer1',150,'visible'); 
    return false;
}

function doCloseComment(type)
{ 
   setVisible('popupContainer1',0,'hidden');   
    var d = document.getElementsByTagName('BODY')[0];
    var olddiv = document.getElementById("popupContainer1");
    d.removeChild(olddiv);
    //alert(self.parent.location.href);
    var currURL = self.parent.location.href.toLowerCase();
    if(currURL.indexOf("video.aspx") >= 0 || currURL.indexOf("music.aspx") >= 0)
        eval(greturnfuncion+"("+ type +")");
    else
    {
        if (type == 1)       
            eval(greturnfuncion+"()");
    }    
}

function ChangeImgPathURLUsers()
{   
    strImgCloseBtnPath = "ESLMulticolor/../images/Popup/popUpCloseBtn.gif";
    strImgPopupstickleft = "ESLMulticolor/../images/Popup/popUpBotStickLeft.gif";
    strImgPopupstickright = "ESLMulticolor/../images/Popup/popUpBotStickRight.gif";   
}
 