﻿function land(ref, target)
{
lowtarget=target.toLowerCase();
if (lowtarget=="_self") {window.location=loc;}
else {if (lowtarget=="_top") {top.location=loc;}
else {if (lowtarget=="_blank") {window.open(loc);}
else {if (lowtarget=="_parent") {parent.location=loc;}
else {parent.frames[target].location=loc;};
}}}
}
function jump(menu)
{
ref=menu.choice.options[menu.choice.selectedIndex].value;
splitc=ref.lastIndexOf("*");
target="";
if (splitc!=-1)
{loc=ref.substring(0,splitc);
target=ref.substring(splitc+1,1000);}
else {loc=ref; target="_self";};
if (ref != "") {land(loc,target);}
}
function surfto(form) {
var myindex2=form.select2.selectedIndex
var translation="http://test.ai.org/demand?mtlang=enes&translate="
if (document.location.href.match(/\?/))
{
location=translation + form.select2.options[myindex2].value;
}
else
{
location=form.select2.options[myindex2].value;
}
}
function hideDiv(pass) {
var divs = document.getElementsByTagName('div');
for(i=0;i<divs.length;i++){
if(divs[i].id.match(pass)){//if they are 'see' divs
if (document.getElementById) // DOM3 = IE5, NS6
divs[i].style.display="none";// show/hide
else
if (document.layers) // Netscape 4
document.layers[divs[i]].display = 'none';
else // IE 4
document.all.hideShow.divs[i].visibility = 'none';
}
}
}
function showDiv(pass) {
var divs = document.getElementsByTagName('div');
for(i=0;i<divs.length;i++){
if(divs[i].id.match(pass)){
if (document.getElementById)
divs[i].style.display="block";
else
if (document.layers) // Netscape 4
document.layers[divs[i]].display = 'block';
else // IE 4
document.all.hideShow.divs[i].visibility = 'block';
}
}
} 
function gettip(image)
{
document.getElementById('tip').innerHTML="<img src='" + image + "' />"
}
function reset()
{
document.getElementById('tip').innerHTML="<img src='" + image + "' />"
}
function OpenWindow(url, width, height)
{
    var load = window.open(url,'','scrollbars=no,menubar=no,height=' + height + ',width=' + width + ',resizable=no,toolbar=no,location=no,status=no');
}
 
// isEmail (STRING s [, BOOLEAN emptyOK])
// whitespace characters
var whitespace = " \t\n\r";
// 
// Email address must be of form a@b.c ... in other words:
// * there must be at least one character before the @
// * there must be at least one character before and after the .
// * the characters @ and . are both required
function isValidEmail(s)
{   
    if (isEmpty(s)) return false;
   
    // is s whitespace?
    if (isWhitespace(s)) return false;
        
    // there must be >= 1 character before @, so we
    // start looking at character position 1 
    // (i.e. second character)
    var i = 1;
    var sLength = s.length;
    // look for @
    while ((i < sLength) && (s.charAt(i) != "@"))
    { i++
    }
    if ((i >= sLength) || (s.charAt(i) != "@")) return false;
    else i += 2;
    // look for .
    while ((i < sLength) && (s.charAt(i) != "."))
    { i++
    }
    // there must be at least one character after the .
    if ((i >= sLength - 1) || (s.charAt(i) != ".")) return false;
    else return true;
}
// Check whether string s is empty.
function isEmpty(s)
{   
    return ((s == null) || (s.length == 0))
}
// Returns true if string s is empty or 
// whitespace characters only.
function isWhitespace(s)
{   
    var i;
    // Is s empty?
    if (isEmpty(s)) return true;
    // Search through string's characters one by one
    // until we find a non-whitespace character.
    // When we do, return false; if we don't, return true.
    for (i = 0; i < s.length; i++)
    {   
        // Check that current character isn't whitespace.
        var c = s.charAt(i);
        if (whitespace.indexOf(c) == -1) return false;
    }
    // All characters are whitespace.
    return true;
}
function checkForm() { 
    if (!isValidEmail(document.subscribeForm.elements['Email Address'].value)) {
    document.subscribeForm.elements['Email Address'].style.backgroundColor='yellow';
        alert("Please enter a valid Email Address. (name@host.com)");
        document.subscribeForm.elements['Email Address'].focus();
        return false;
    }
}
function populateElementIdInnerHTML_oc3(element_id)
{
    
    if (opener)
    {
        var update4_html = opener.document.transfer4_html.popup4_html.value;
        if (update4_html)
        {            document.getElementById(element_id).innerHTML = update4_html;
        }
    }
    else
    {
        document.getElementById(element_id).innerHTML ="<p><b>Sorry, unable to locate the parent page</b></p>";
    }
}
function populateElementIdInnerHTML_oc4(element_id)
{
    
    if (opener)
    {
        var update5_html = opener.document.transfer5_html.popup5_html.value;
        if (update5_html)
        {            document.getElementById(element_id).innerHTML = update5_html;
        }
    }
    else
    {
        document.getElementById(element_id).innerHTML ="<p><b>Sorry, unable to locate the parent page</b></p>";
    }
}
function populateElementIdInnerHTML_oc5(element_id)
{
    
    if (opener)
    {
        var update6_html = opener.document.transfer6_html.popup6_html.value;
        if (update6_html)
        {            document.getElementById(element_id).innerHTML = update6_html;
        }
    }
    else
    {
        document.getElementById(element_id).innerHTML ="<p><b>Sorry, unable to locate the parent page</b></p>";
    }
}
function populateElementIdInnerHTML_oc6(element_id)
{
    
    if (opener)
    {
        var update7_html = opener.document.transfer7_html.popup7_html.value;
        if (update7_html)
        {            document.getElementById(element_id).innerHTML = update7_html;
        }
    }
    else
    {
        document.getElementById(element_id).innerHTML ="<p><b>Sorry, unable to locate the parent page</b></p>";
    }
}
 
// JavaScript Document
/***********************************************
* IFrame SSI script II- © Dynamic Drive DHTML code library (http://www.dynamicdrive.com)
* Visit DynamicDrive.com for hundreds of original DHTML scripts
* This notice must stay intact for legal use
***********************************************/
//Input the IDs of the IFRAMES you wish to dynamically resize to match its content height:
//Separate each ID with a comma. Examples: ["myframe1", "myframe2"] or ["myframe"] or [] for none:
var iframeids=["myframe"]
//Should script hide iframe from browsers that don't support this script (non IE5+/NS6+ browsers. Recommended):
var iframehide="yes"
var getFFVersion=navigator.userAgent.substring(navigator.userAgent.indexOf("Firefox")).split("/")[1]
var FFextraHeight=parseFloat(getFFVersion)>=0.1? 16 : 0 //extra height in px to add to iframe in FireFox 1.0+ browsers
function resizeCaller() {
var dyniframe=new Array()
for (i=0; i<iframeids.length; i++){
if (document.getElementById)
resizeIframe(iframeids[i])
//reveal iframe for lower end browsers? (see var above):
if ((document.all || document.getElementById) && iframehide=="no"){
var tempobj=document.all? document.all[iframeids[i]] : document.getElementById(iframeids[i])
tempobj.style.display="block"
}
}
}
function resizeIframe(frameid){
var currentfr=document.getElementById(frameid)
if (currentfr && !window.opera){
currentfr.style.display="block"
if (currentfr.contentDocument && currentfr.contentDocument.body.offsetHeight) //ns6 syntax
currentfr.height = currentfr.contentDocument.body.offsetHeight+FFextraHeight; 
else if (currentfr.Document && currentfr.Document.body.scrollHeight) //ie5+ syntax
currentfr.height = currentfr.Document.body.scrollHeight;
if (currentfr.addEventListener)
currentfr.addEventListener("load", readjustIframe, false)
else if (currentfr.attachEvent){
currentfr.detachEvent("onload", readjustIframe) // Bug fix line
currentfr.attachEvent("onload", readjustIframe)
}
}
}
function readjustIframe(loadevt) {
var crossevt=(window.event)? event : loadevt
var iframeroot=(crossevt.currentTarget)? crossevt.currentTarget : crossevt.srcElement
if (iframeroot)
resizeIframe(iframeroot.id);
}
function loadintoIframe(iframeid, url){
if (document.getElementById)
document.getElementById(iframeid).src=url
}
if (window.addEventListener)
window.addEventListener("load", resizeCaller, false)
else if (window.attachEvent)
window.attachEvent("onload", resizeCaller)
else
window.onload=resizeCaller

document.write('<script type="text/javascript" src="http://www.in.gov/ai/rightnow/syndication_widget/arss.js"></script>');
function faqload(){
    document.getElementById('want').style.display='none';document.getElementById('faq').style.display='none';
 
    var reader2 = RNTFeed.getReader();
    reader2.uri='http://iot.custhelp.com/cgi-bin/iot.cfg/php/enduser/opensearch.php?p_cv=2.150';
    reader2.pagesize = 5;
    reader2.navigation = "off";
    reader2.searchbox = "off";
    reader2.render("faqdivload");
    reader2.search("");
    var timeX = setTimeout("document.getElementById('want').style.display='block'", 500);
}