//demo poup window script//

//function popupwindow(){document.avdemo
//window.open("resources/av_demo_SIA.swf","","height=600,width=800,menubar=0,resizable=0,scrollbars=0,status=0,titlebar=0,toolbar=0,left=160,top=150")
//}

//child window functions
function openchildwindow(thisurl) {
  popwin = window.open(thisurl,"","left = 100,top =0,scrollbars=no,resizable,width=900,height=800")
}

function openchildwindownews(thisurl) {
  popwin = window.open(thisurl,"","left = 200,top =100,scrollbars=yes,resizable=no,width=750,height=600")
} 

var win = null;
function NewWindow(mypage,myname,w,h,scroll){
LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
settings =
'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable=no'
win = window.open(mypage,myname,settings)
}

function openWin(url,wid,hgt)
{
sh = (screen.height - hgt) / 2;
sw = (screen.width - wid) / 2;
var newwin = window.open(url,'win','width='+wid+',height='+hgt+',top='+sh+',left='+sw+'');
if(newwin) newwin.focus();
return false;
}
//webinar popup window/
var win = null;
function FormsWindow(mypage,myname,w,h,scroll){
LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
settings =
'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars=yes,resizable=yes'
win = window.open(mypage,myname,settings)
}
// search arrow function//
function Select(id)
{
	//alert("here");
	document.getElementById(id).style.backgroundImage = "url(images/link_bg1.gif)";
	document.getElementById(id).style.color = "#1868c4";
}
function UnSelect(id)
{
	//alert("here");
	document.getElementById(id).style.backgroundImage = "url(images/left-nav_bg.gif)";
	document.getElementById(id).style.color = "#58595b";
}

function Load(pageUrl)
{
	window.open(pageUrl, '_self');
	var anchorNo = pageUrl.split("#")[1];
	}

// free trail& Attend a Webinar//

function LoadToTarget(pageTarget, pageUrl) {
    window.open(pageUrl, pageTarget);
    var anchorNo = pageUrl.split("#")[1];
}

window.onload = function() {
    var inp = document.getElementById('search'),
	defaultimg = 'images/arrowser.gif'; // image path;

    if (inp.value == "")
        inp.style.background = 'url(' + defaultimg + ') left center no-repeat';
        
    inp.onfocus = function() {
        this.style.background = 'transparent';
    }
    inp.onblur = function() {
       
        if (this.value == "")
            this.style.background = 'url(' + defaultimg + ') left center no-repeat';
    }

	var url = document.URL;
	var anchorNo = url.split("#")[1];

}
function openchildwindow1(thisurl) {
  popwin = window.open(thisurl,"","left = 100,top =0,scrollbars=no,resizable,width=1010,height=700")
}

function openchildwindow2(thisurl) {
  popwin = window.open(thisurl,"","left = 100,top =0,scrollbars=no,resizable,width=1050,height=760")
}

function openchildwindow3(thisurl) {
  popwin = window.open(thisurl,"","left = 100,top =0,scrollbars=no,resizable,width=1050,height=860")
}

 /*validation*/

  function checkForm() {
name = document.getElementById("search").value;
  
  if (name == "") {
  hideAllErrors();
document.getElementById("nameError").style.display = "inline";
document.getElementById("search").select();
document.getElementById("search").focus();
  return false;
  } 
  return true;
  }
 
  function hideAllErrors() {
document.getElementById("nameError").style.display = "none"

  }
  
  /*popup window*/ 
/*  
  var win = null;
function NewWindow(mypage,myname,w,h,scroll){
LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
settings =
'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable=no'
win = window.open(mypage,myname,settings)
}*/
