﻿var obj = document.getElementById("RJDiv");
var IE = document.all?true:false
var DomainStr = "http://www.reportjunction.com"
width = 250
height = parseInt(height)
 
var styleString ="width:" + width + "px;height:" + (height+5) + "px;font-size:12px;font-family: Arial;padding:10px 0px 10px 0px;font-weight: bold;background-color:#FFFFFF;color:#696868;float:left;";
var IntpustyleString ="font-size:11px;font-family: Arial;color:#696868;font-weight:bold;";
var LinkText="font-family: Arial;font-size: 10px;color: #696868;";

if (!IE)
     obj.setAttribute("style",styleString);
  else 
     obj.style.cssText=styleString ;

var urlStr = DomainStr + "/Aff/AffAd.htm?key=" + key + "&industry=" + industry + "&height=" + height

divContent = "<div style='margin-bottom:2px;text-align:left;'>&nbsp;&nbsp;Search: ";
divContent += "<input type='text' id='txtRJSearch' size='10' style='"+IntpustyleString+"'>&nbsp;";
divContent += "<input type='button' id='btnRJSearch' value='Search' style='"+IntpustyleString+"' onClick='RJSearch()'>";
divContent += "</div>";
divContent += "<iframe id='rjdata' src='" + urlStr + "' style='height:" + (height - 20) + "px;width:100%;' scrolling='no'   frameborder='0' ></iframe>";
divContent += "<div style='"+LinkText+"'>";
divContent += "&nbsp;&nbsp;Annual Reports By ";
divContent += "<a style='"+LinkText+"' href='" + DomainStr + "'>reportjunction.com</a></div>";
obj.innerHTML = divContent;

document.onkeydown = checkKeycode
function checkKeycode(e) 
{
    var keycode;
    count=0;
    if (window.event) keycode = window.event.keyCode;
    else if (e) keycode = e.which;
    if(keycode==13)
    {
        document.getElementById("btnRJSearch").click();
    }
    
}
function RJSearch()
{
    if(document.getElementById("txtRJSearch").value!="")
    {   
        var url = DomainStr + "/Aff/Search-" + document.getElementById("txtRJSearch").value + "-" + key + ".htm";
        window.open(url,'Reportjunction'); 
    }
}
