function showIframe(divid,url) {
    var divstr = '<div id="iframeResult" style="background:#FFFFFF; border:1px solid #80A0C0; position: relative; width: 610px; height: 300px; z-index: 50; left: 0px; top: 0px;">';
    divstr += '<div id="closeimg" class="closetextreg" onclick="closeIframe(\''+ divid + '\',\'iframeResult\')" style="cursor:pointer; position: absolute; width: 50px; height: 15px; z-index: 3; left: 565px; top: 3px; ">';
    divstr += 'Close X</div>';
    divstr += '<iframe style="position: absolute;top: 50px; height: 250px; width: 610px;border: none;" src="'+url+'"/>';
    document.getElementById(divid).innerHTML = '';
    document.getElementById(divid).innerHTML=divstr;
}

function closeIframe(parent,divid) {
    var nodeToRemove = document.getElementById(divid);
    nodeToRemove.style.display='none';
    nodeToRemove.getElementsByTagName("iframe").src='';
    nodeToRemove.innerHTML = '';
    document.getElementById(parent).removeChild(nodeToRemove);
}
function showVideos(urlid,divv1,divv2,divv3){

    var ele_visibibility = document.getElementById(divv2).style.display;
    if(ele_visibibility == "none")
    {
        document.getElementById(divv2).style.display ='';
        document.getElementById(divv3).style.display ='';
        document.getElementById(divv2).style.width='300px';
        document.getElementById(divv2).style.height='200px';
        document.getElementById(divv3).style.width='300px';
        document.getElementById(divv3).style.height='180px';
        document.getElementById(divv1).style.height='350px';
        //  alert(contentstr[urlid].contenturl);
        document.getElementById(divv2).innerHTML=contentstr[urlid].contenturl;

    }
    else
    {
        document.getElementById(divv2).style.display ='none';
        document.getElementById(divv3).style.display ='none';
        document.getElementById(divv2).style.width='0px';
        document.getElementById(divv2).style.height='0px';
        document.getElementById(divv3).style.width='0px';
        document.getElementById(divv3).style.height='0px';
        document.getElementById(divv1).style.height='auto';
    }
}

function showPostLinkDescp(obj1, obj2)
{
    if(obj1 == 'describetxtlabelexpert'){
        document.getElementById("describetxtlabelexpert").style.display = '';
        document.getElementById("describetxtlabelexplorer").style.display = 'none';
        document.getElementById(obj2).style.display = '';
        document.getElementById("category_expert").disabled = '';
    }
    else if(obj1 == 'describetxtlabelexplorer') {
        document.getElementById("describetxtlabelexplorer").style.display = '';
        document.getElementById("describetxtlabelexpert").style.display = 'none';
        document.getElementById(obj2).style.display = 'none';
        document.getElementById("category_expert").disabled = 'true';
    }
}

function insertContent(actionURL,output,content_type)
{   
    var content_url = document.getElementById("contenturl").value;
    var content_lang = document.getElementById("contentlang").value;
    var content_type1;
    var content_name = document.getElementById("contentname").value;
    var content_description = document.getElementById("contentdescription").value;    
    var category = setDropDownValue(document.getElementById("catlevel1")) +"#" +
    setDropDownValue(document.getElementById("catlevel2")) + "#" +
    setDropDownValue(document.getElementById("catlevel3"));
    var category_expert = document.getElementById("category_expert").checked;
    var c_diff = document.getElementsByName("contentdifficulty");
    var content_difficulty = getCheckedValue(c_diff);
    //var exp_description = document.getElementById("expdescription").value;
    var content_keywords = document.getElementById("contentkeywords").value;

    document.getElementById('errorContent').innerHTML = '';

    content_url = extractURL(content_url);
    if(content_url != "")
    {
        document.getElementById('contenturlcheck').innerHTML = '';
    }
    else
    {
        //document.getElementById('contenturlcheck').style.color = '#990000';
        document.getElementById('contenturlcheck').innerHTML = '<div><img alt="" src="'+contextRoot+'/static/images/error.png"></div><div style=" margin-top: -30px; padding-left: 25px; position: absolute; color:#990000;">Invalid or Empty URL. At present we support only YouTube/SlideShare video URLs/Embed XML</div>';
        return false;
    }
    for(var j=1; j<=3; j++){
        var contentValue= content_type+j;
        if(document.getElementById(contentValue).checked) {
            content_type1 = document.getElementById(contentValue).value;
        }
    }

    //If none of two are checked by the value will be 2. That is nighter expert nor explorer
    if(content_difficulty == "")
    {
        content_difficulty = 2;
    }
        
    if(content_name == 'Write an accurate and meaningful Title for the content')
    {
        document.getElementById('errorContent').style.display = '';
        document.getElementById('errorContent').innerHTML = 'Please enter a title';
        document.getElementById("contentname").focus();
        return false;
    }

    else if(content_description == 'Enter detailed description of the content, as often people don\'t understand just from the title')
    {
        document.getElementById('errorContent').style.display = '';
        document.getElementById('errorContent').innerHTML = 'Please add some description about this content';
        document.getElementById("contentdescription").focus();
        return false;
    }
    else if(category == '##' || document.getElementById('catlevel2').value == '' || document.getElementById('catlevel3').value == '')
    {
        document.getElementById('errorContent').style.display = '';
        document.getElementById('errorContent').innerHTML = 'Please select the suitable categories';
        return false;
    }
    //    else if(exp_description == 'Enter Experience on this topic or area')
    //    {
    //        document.getElementById('errorContent').style.display = '';
    //        document.getElementById('errorContent').innerHTML = 'Please add some experience on this topic or area';
    //        document.getElementById("expdescription").focus();
    //        return false;
    //    }
    else if(content_keywords == 'Enter tags related to the content, so others can find them easily')
    {
        document.getElementById('errorContent').style.display = '';
        document.getElementById('errorContent').innerHTML = 'Please enter some tags separated by comma';
        document.getElementById("contentkeywords").focus();
        return false;
    }
    else
    {
        var url = actionURL;
        var querystr = 'content_url=' + escape(content_url) +
        '&content_name=' + escape(content_name) +
        '&category=' + escape(category) +
        '&description=' + escape(content_description) +//'-'+
        //escape(exp_description) +
        '&keywords=' + escape(content_keywords) +
        '&category_expert=' + escape(category_expert) +
        '&content_difficulty='+ content_difficulty +
        '&content_lang=' + escape(content_lang) +
        '&content_type=' + escape(content_type1);
        var funcToCall = contentInserted;
        var displayDataIn = output;
        if(login_user == null || login_user == '')
        {
            ModalPopup.Close('PostLinkPopUp','1');
            ModalPopup('NewLoginpopupdiv','');
            document.getElementById('login_details').value = 'postcontent:'+url+':'+querystr;
            document.getElementById('regRedirect').value = 'postcontent:'+url+':'+querystr;
           
        }
        else
        {
            fetchServerResponse(url,querystr,funcToCall,displayDataIn);
            ModalPopup.Close('PostLinkPopUp', '1');
            MyContent('KBSearch.do','2','Content',2,'MyNetwork',username);
        }
        return true;
    }
}

function postContent(url, querystr, output){
    var funcToCall = contentInserted;
    var displayDataIn = output;
    fetchServerResponse(url,querystr,funcToCall,displayDataIn);
    //setTimeout("MyContent('KBSearch.do','2','Content',2,'middle_div',username)","5000");
}
function getVideoList(actionURL,displayDataIn)
{
    var search_str = document.getElementById('search_str').value;
    if(search_str == "")
    {
        document.getElementById('search_str_check').innerHTML = '';
        document.getElementById('search_str_check').innerHTML = 'Enter a search string';
        return false;
    }
    else
    {
        document.getElementById('search_str_check').innerHTML = '';
    }
    var url = actionURL;
    var funcToCall = videoList;
    var queryStr = 'search_str='+escape(search_str);
    fetchServerResponse(url,queryStr,funcToCall,displayDataIn);
    return true;
}

function contentInserted(result,divname)
{
    var experts, explorers;
    var successMsg = result.split("####")[0];
    var content_name = result.split("####")[1];
    var content_url = result.split("####")[2];
    var content_type = result.split("####")[3];
    var content_id = result.split("####")[4];
    var category = result.split("####")[5];
    var contentAssoAs = result.split("####")[6];
    if(contentAssoAs == 0){
        experts = 0;
        explorers = 1;
    }
    else if(contentAssoAs == 1){
        experts = 1;
        explorers = 0;
    }
    var category_name = '["' + category + '"]';
    //document.getElementById(divname).innerHTML = '';
    //document.getElementById(divname).innerHTML=result;
    clearErrorMessage();
    successMsg += '<span class="action" style=\'color:#990000; margin-left:5px;\' onclick="showContentFromIndex(\''+contextRoot+'/jsp/ContentHome.jsp?id='+content_id+'&searchId=1&source=ezdia&content_url='+content_url+'\',\'ConnectionPopUp\',\'ConnectionPopUp\')" >View your content</span><img hspace="5" title="Forward" src="../static/images/forwardIcon.png" alt="Forward"/><span class="action" onclick="showcommondiv('+'\'ForwardContent.jsp?isForward=true&flag=content&content_name='+escape(content_name)+'&content_url='+escape(content_url)+'&content_type='+content_type+'&id='+content_id+'&category_name='+escape(category_name)+'&expert_users='+experts+'&explorer_users='+explorers+'&actual_url='+escape(content_url)+'\',\'ConnectionPopUp\','+'\'ConnectionPopUp\');">Forward</span>';
    setErrorMessage(successMsg,1);                                                        
    //document.getElementById('success').style.display = '';
}

function contentList(result,divname)
{
    var video_lst = eval('('+result+')');
    var i = 0;
    var outputstr = '<div id="videotab" onclick=showMessageResult("../jsp/learning3.jsp","mainvideodiv","") class="learning_video_tab " style="border: 1px solid #C0C0C0; position: relative; width: 49px; height: 16px; z-index: 19; left: 296px; top: 10px; cursor: pointer; text-decoration: none; ">';
    outputstr += 'Videos</div>';
    outputstr += '<div id="learningtab0" class="learning_video_tab " style="border: 1px solid #C0C0C0; position: relative; width: 49px; height: 16px; z-index: 19; left: 562px; top: -8px; cursor: pointer; text-decoration: none;">';
    outputstr += 'Favorite</div>';
    outputstr += '<div id="learningtab" onclick=showMessageResult("../jsp/learning2.jsp","mainvideodiv","") class="learning_video_tab " style="border: 1px solid #C0C0C0; position: relative; width: 98px; height: 16px; z-index: 19; left: 463px; top: -26px; cursor: pointer; text-decoration: none;">';
    outputstr += 'Learning Buddy</div>';
    outputstr += '<div id="experttab" class="learning_video_tab " style="border: 1px solid #C0C0C0; position: relative; width: 58px; height: 16px; z-index: 19; left: 404px; top: -44px; cursor: pointer; text-decoration: none;">';
    outputstr += 'Experts</div>';
    outputstr += '<div id="articletab" class="learning_video_tab " style="border: 1px solid #C0C0C0; position: relative; width: 57px; height: 16px; z-index: 19; left: 346px; top: -62px; cursor: pointer; text-decoration: none;">';
    outputstr += 'Articles</div>';
    outputstr += '<div id="alltab" onclick=showMessageResult("../jsp/learning1.jsp","learning_div2","") class="learning_video_tab " style="border: 1px solid #C0C0C0; position: relative; width: 40px; height: 16px; z-index: 19; left: 255px; top: -80px; cursor: pointer; text-decoration: none;background-color: #336699; color: #FFFFFF;">';
    outputstr += 'All</div>';
    outputstr += '<div id="topline2"style="background:#e6e6e6; position: relative; width: 430px; height: 1px; z-index: 8; left: 209px; top: -81px; ">';
    outputstr += '</div>';
    outputstr += '<div id="mainvideodiv" style="position: relative; width: 624px; height: auto; z-index: 20; left: 5px; top: -75px">';
    outputstr += '<div id="videos" class="learning_video_subheading " style="position: relative; width: 55px; height: 19px; z-index: 6; left: 30px; top: -10px;">Videos</div>';
    for(i =0; i < video_lst.length; i++)
    {
        contentstr[i] = new UserContent('<object width="300" height="200" align="center"><param name="movie" value="'+video_lst[i].location+'&fs=1"></param><param name="wmode" value="transparent"></param><param name="allowFullScreen" value="true"></param><embed src="'+video_lst[i].location+'&fs=1" type="application/x-shockwave-flash" allowfullscreen="true" wmode="transparent" width="300" height="200"></embed></object>');
        //  alert(i+"\n"+contentstr[i].contenturl);
        outputstr += '       <div id="v1'+i+'" style="position: relative; width: 620px; height: auto; z-index: 9; left: 0px; top: 0px;">';
        outputstr += '  <div id="videoicon1" style="cursor:pointer;position: relative; width: 35px; height: 35px; z-index: 1; left: 20px; top: 5px">';
        outputstr += '  <img alt="image1" onclick=getEmbedURLs("'+i+'","v1'+i+'","v2'+i+'","v3'+i+'","vt'+i+'") height="37" src="../static/images/videosmallicon.jpg" width="37" /></div>';
        outputstr += '  <div id="layer23" class="learning_search_title" style="position: relative; width: 232px; height: 16px; z-index: 2; left: 60px; top: -28px">';
        outputstr += '  <b> ' + video_lst[i].name  + '</b></div>';
        outputstr += '  <div id="introCategory3" style="position: relative; width: 120px; height: 90px; z-index: 3; left: 76px; top:-30px">';
        outputstr += '      <span class="learning_video_selection">' + video_lst[i].description + '<br />';
        outputstr += '      Author</span><br class="learning_video_selection" />';
        outputstr += '     <span class="learning_video_selection">' + video_lst[i].description + '</span><br class="learning_video_selection" />';
        outputstr += '     <span class="learning_video_selection">Number of hits </span><br/>';
        outputstr += '     <span class="learning_video_selection">Reviews </span><br/>';
        outputstr += '     <span class="learning_video_selection">' + video_lst[i].experts + ' Experts of this video</span>';
        outputstr += '</div>';
        outputstr += '  <div id="intromenu1" class="learning_video_title1" style="position: relative; width: 237px; height: 15px; z-index: 4; left: 210px; top: -40px">';
        outputstr += '  <span class="action" onclick=addExpert("addExpert.do",' + video_lst[i].content_id + ',"experts'+i+'")>Add as Expert</span> | Read article | Refer a friend | Read later </div>';
        outputstr += '  <div id="expertlist1"  class="learning_video_title1" style="position: relative; width: 60px; height: 13px; z-index: 5; left: 520px; top: -145px">';
        outputstr += '  <span class="action" onclick=getExperts("experts.do",' + video_lst[i].content_id + ',"experts'+i+'")>Expert List</span></div>';
        outputstr += '  <div id="experts' +i+ '"  class="learning_video_title1" style="position: relative; width: 100px; height: 13px; z-index: 5; left: 520px; top: -145px"></div>';
        outputstr += '  <div id="v2'+i+'" align="center" style="position: relative;top:-40px;width:0px;height:0px;left:170px;z-index: 3;">';
        outputstr += '</div>';
        outputstr += '  <div id="v3'+i+'" align="center" style="background-color:white;opacity: .05;filter: alpha(opacity=1);position: relative;top:-242px;width:0px;height:0px;left:170px;z-index: 20;">';
        outputstr += '</div>';
        outputstr += ' <div id="vt'+i+'" style="background: #e6e6e6; position: relative; width: 623px; height: 2px; z-index: 8; left: -3px; top:-40px; ">';
        outputstr += '  </div>';

        outputstr += '</div>';
    }
    outputstr+= '</div>';
    // alert(outputstr + " " + divname);
    document.getElementById(divname).innerHTML = '';
    document.getElementById(divname).innerHTML=outputstr;

}


function getExperts(actionURL,contentId,displayDataIn)
{
    var url = actionURL;
    var funcToCall = listExperts;
    var queryStr = 'contentId='+escape(contentId);
    fetchServerResponse(url,queryStr,funcToCall,displayDataIn);
}

function listExperts(result,divname)
{
    var jsonContent = eval('('+result+')');
    var i = 0;
    var output='';
    var top1 =115 ;
    for(i = 0; i < jsonContent.length; i++ )
    {
        if(jsonContent[i].response){
            output+=jsonContent[i].response;
        }
        else{
            ExpertsList[jsonContent[i].username] = new UserInfo(jsonContent[i].username,jsonContent[i].firstname,jsonContent[i].photo,jsonContent[i].summary,jsonContent[i].workarea,jsonContent[i].country,jsonContent[i].reviews,jsonContent[i].rating,jsonContent[i].rpm,jsonContent[i].category);

            output+='<div id="lul'+i+'" onmouseout=mclosetime() onmouseover=viewBusinessCard('+jsonContent[i].username+',"mulpv'+jsonContent[i].username+'",event,"lul'+i+'","expertiselist") style="cursor:pointer;position: relative; width: 150px; height: 15px; z-index: 1; left: 0px; top: 0px">';
            output+='<div id="mulpv'+jsonContent[i].username+'" onmouseout="mclosetime()" onmouseover="mcancelclosetime()" style="display:none;border: 1px solid #80A0C0; left:80px; position: absolute; width: 355px; height: 130px; z-index: 100; background-color: #FFFFFF; text-decoration: none;"></div>';
            output+=jsonContent[i].firstname;
            output+='</div>';
            top1+=15;
        }
    }
    document.getElementById(divname).innerHTML = '';
    document.getElementById(divname).innerHTML=output;

}

function addExpert(actionURL,contentId,displayDataIn)
{
    var url = actionURL;
    var funcToCall = listExperts;
    var queryStr = 'contentId='+escape(contentId);
    fetchServerResponse(url,queryStr,funcToCall,displayDataIn);
}



function expertAdded(result,divname)
{
    document.getElementById(divname).innerHTML = '';
    document.getElementById(divname).innerHTML='expert added';
}

function extractURL(url) {
    if (!url || url == "") return "";
    var regExp1 = /^((http(s?))\:\/\/)?(www|[a-zA-Z]{2,6}).youtube.com\/.*v=([_0-9a-zA-Z-]*)/i;
    //    var regExp2 = /.*value="(http:\/\/www.youtube.com.*=.)"><\/param>.*/i;
    //    var regExp3 = /^http:\/\/www.youtube.com\/v\/.*/i;
    //    var regExp4 = /.*<embed src="(http:\/\/static.slideshare.net\/swf.*)"/i;

    var regExpsURLs = new Array();
    regExpsURLs[0] = /^((http(s?))\:\/\/)?(www|[a-zA-Z]{2,6}).youtube.com\/v\/.*/i;
    regExpsURLs[1] = /^((http(s?))\:\/\/)?(www|[a-zA-Z]{2,6}).slideshare.net\/\w*\/\w+/i
    var regExpsEmbeds = new Array();
    regExpsEmbeds[0] = /.*value="(http:\/\/(www|[a-zA-Z]{2,6}).youtube.com.*=.)"><\/param>.*/i;
    regExpsEmbeds[1] = /.*href="(http:\/\/(www|[a-zA-Z]{2,6}).slideshare.net\/\w*\/\w.*?src=embed)".*/i
    //regExpsEmbeds[1] = /.*<embed src="(http:\/\/static.slideshare.net\/swf\/.*?\w)"/i;

    var regExpURLAny = /^(((http(s?))|(ftp))\:\/\/)?(www.|[a-zA-Z].)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,6})(\:[0-9]+)*(\/($|[a-zA-Z0-9\.\,\;\?\'\\\+&%\$#\=~_\-\(\)]+))*$/;

    var i = 0;
    for(i = 0 ; i < regExpsURLs.length ; i++)
    {
        if (regExpsURLs[i].test(url)) {
            return url;
        }
    }
    var match = regExp1.exec(url);
    if (match && match[4] && match[5]) {
        return "http://"+ match[4] +".youtube.com/v/" + match[5] + "&hl=en&fs=1";
    }

    for(i = 0; i < regExpsEmbeds.length;i++)
    {
        match = regExpsEmbeds[i].exec(url);
        if (match) {
            return match[1];
        }
    }

    if(regExpURLAny.test(url))
    {
        return /^http.*/.exec(url)?url:("http://"+url);
    }

    return "";
}

function validateURLBox(flag)
{
    if(flag == 1){
        var content_url = document.getElementById('contenturl').value;
        content_url = extractURL(content_url);
        if(content_url != "")
        {
            document.getElementById('contenturlcheck').innerHTML = '';
        }
        else
        {
            //document.getElementById('contenturlcheck').style.color = '#990000';
            document.getElementById('contenturlcheck').innerHTML = '<div><img alt="" src="'+contextRoot+'/static/images/error.png"></div><div style=" margin-top: -30px; padding-left: 25px; position: absolute; color:#990000;">Invalid or Empty URL. At present we support only YouTube/SlideShare video URLs/Embed XML</div>';
            //document.getElementById('contenturlcheck').innerHTML = 'Invalid or Empty URL. At present we support only YouTube/SlideShare video URLs/Embed XML';
            return;
        }
    }
    var url = contextRoot+'/jsp/contentExists.do';
    var funcToCall = contentExists;
    var queryStr = 'content_url='+escape(content_url);
    var displayDataIn = 'contenturlcheck';
    fetchServerResponse(url,queryStr,funcToCall,displayDataIn);
}

function contentExists(result,divname)
{
    if(trim(result) == "1")
    {   
        document.getElementById(divname).innerHTML = '';
        document.getElementById(divname).innerHTML='<div><img alt="" src="'+contextRoot+'/static/images/error.png"></div><div style="padding-left: 25px; position: absolute; top: 24px; color:#990000;">Content Already Exists</div>';
        document.getElementById('submitcontent_btn').disabled = true;
        return true;
    }
    else
    {
        document.getElementById(divname).innerHTML = '';
        document.getElementById(divname).innerHTML = '<div><img alt="" src="'+contextRoot+'/static/images/success.png"></div><div style="position: absolute; margin-top: -20px; padding-left: 25px; color: green;">New Content</div>';
    //        document.getElementById(divname).innerHTML = 'New Content';
            document.getElementById('submitcontent_btn').disabled = false;
    //        document.getElementById('submit_btn_kb').style.display=''
    }
    getAreaAndFill('catlevel1');
}

function getPreview(x)
{
    e=x;
    var videoURL = extractURL(document.getElementById('contenturl').value);
    var previewURL = extractURL(videoURL);
    var divname = 'ConnectionPopUp';
    if(/.*slideshare.*/.test(previewURL))
    {
        var url='previewURL.do?content_url='+escape(previewURL);
        showResultWithQueryStr(url, divname, showURLinPopup, null);
        return true;
    }
    else
    {
        showIframe(divname,videoURL);
        return true;
    }
}

/*TODO unused code <05 Feb 2011> will be removed in 2 months

function showURLinPopup(url, divid) {
    if(url.length > 4){
        var IE = document.all?true:false;

        if (IE) { // grab the x-y pos.s if browser is IE
            tempX = event.clientX;// + document.body.scrollLeft + document.documentElement.scrollLeft;
            tempY = event.clientY ;//+ document.body.scrollTop + document.documentElement.scrollTop;
        }
        else { // grab the x-y pos.s if browser is NS
            tempX = e.pageX;
            tempY = e.pageY;
        }
        if (tempX < 0){
            tempX = 0;
        }
        if (tempY < 0){
            tempY = 0;
        }

        var divstr ='<table id="pop_dialog_tableA" class="pop_dialog_tableA" style="width: auto; margin-left:15px;">';
        divstr +='<tbody>';
        divstr +='<tr>';
        divstr +='<td class="pop_topleftA"/>';
        divstr +='<td class="pop_borderA"/>';
        divstr +='<td class="pop_toprightA"/>';
        divstr +='</tr>';
        divstr +='<tr>';
        divstr +='<td class="pop_borderA"/>';
        divstr +='<td id="pop_contentA" class="pop_contentA">';
        divstr += '<div id="InnerDiv" style="background:#FFFFFF; border:1px solid #80A0C0; position: relative; width: 610px; height: 300px; z-index: 50; left: 0px; top: 0px;">';
        divstr += '<div id="closeimg" class="closetextreg" onclick="closeIframe()" style="cursor:pointer; position: absolute; width: 50px; height: 15px; z-index: 3; left: 565px; top: 3px; ">';
        divstr += 'Close X</div>';
        divstr += '<div id="iframe" onclick=showIframe("' + divid + '",'+escape("http://www.google.com")+') style="cursor:pointer; position: absolute; width: 50px; height: 15px; z-index: 3; left: 300px; top: 3px; ">';
        divstr += 'Iframe</div>';
        divstr += '<div style="position: absolute; left: 150px; top: 50px;">';
        divstr += '<object style="margin:0px" width="300" height="200">';
        divstr += '<param name="movie" value="'+url+'"/>';
        divstr += '<param name="allowFullScreen" value="true"/>';
        divstr += '<param name="allowScriptAccess" value="always"/>';
        divstr += '<embed src="'+url+'" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="300" height="200"></embed>';
        divstr += '</object>';
        divstr +='</div>';
        divstr += '</div>';
        divstr +='</td>';
        divstr +='<td class="pop_borderA"/>';
        divstr +='</tr>';
        divstr +='<tr>';
        divstr +='<td class="pop_bottomleftA"/>';
        divstr +='  <td class="pop_borderA"/>';
        divstr +='<td class="pop_bottomrightA"/>';
        divstr +='</tr>';
        divstr +='</tbody>';
        divstr +='</table>';

        document.getElementById(divid).style.display='';
        document.getElementById(divid).style.top= (tempY-50)+'px';
        document.getElementById(divid).style.marginLeft = newIcordX+'px';
        document.getElementById(divid).innerHTML = '';
        document.getElementById(divid).innerHTML=divstr;
    }else{
        document.getElementById(divid).innerHTML = '';
        document.getElementById(divid).innerHTML='Not a valid Content';
    }
}

*/
