

  /* CR 2614 change starts*/
function disableautocompletion(id1){ 
	 var passwordControl=document.getElementById(id1);
	 passwordControl.setAttribute("autocomplete","off");
}
/* CR 2614 change ends*/ 

function checkSpecial(str){
	var specialChars = "`=[]\\;'~!@$%^&*()+{}|:\"<>?";
	for(var i=0; i<specialChars.length; i++){
			if(str.indexOf(specialChars.substr(i, 1)) >= 0){
			 return false;
			}else{
				continue;
			}
		}
		return true;
 
}
  

function toggle(object) {
  if (document.getElementById) {
    if (document.getElementById(object).style.visibility == 'visible')
      document.getElementById(object).style.visibility = 'hidden';
    else
      document.getElementById(object).style.visibility = 'visible';
  }

  else if (document.layers && document.layers[object] != null) {
    if (document.layers[object].visibility == 'visible' ||
        document.layers[object].visibility == 'show' )
      document.layers[object].visibility = 'hidden';
    else
      document.layers[object].visibility = 'visible';
  }

  else if (document.all) {
    if (document.all[object].style.visibility == 'visible')
      document.all[object].style.visibility = 'hidden';
    else
      document.all[object].style.visibility = 'visible';
  }

  return false;
}

function popUp(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
function init(){
	var stretchers = document.getElementsByClassName('box');
	var toggles = document.getElementsByClassName('tab');
	var myAccordion = new fx.Accordion(
		toggles, stretchers, {opacity: true, height: true, duration: 600}
	);
	//hash functions
	var found = false;
	toggles.each(function(spann, i){
		var div = Element.find(span, 'nextSibling');
			if (window.location.href.indexOf(span.title) > 0) {
				myAccordion.showThisHideOpen(div);
				found = true;
			}
		});
		if (!found) myAccordion.showThisHideOpen(stretchers[0]);
}




/* BEGIN: [Tab Switch Function] */

function tabSwitch(me){
	me.className = me.className.replace("_off","_on"); // set the tab to "On"
	for(i=0; i<me.parentNode.childNodes.length; i++){  // cycle through the tags in the containing node of this anchor						
		if(me.parentNode.childNodes[i].title != me.title){ // look for everthing that isn't the anchor you just changed
			if(me.parentNode.childNodes[i].className == me.className){ // find the class name that matches the current class name
				me.parentNode.childNodes[i].className = me.parentNode.childNodes[i].className.replace("_on","_off"); // Turn them all "Off"
			}
			if(me.parentNode.childNodes[i].title == me.title+"_Data"){  // find the associated "Data" with the user picked (related by titles)
				me.parentNode.childNodes[i].style.display = "block"; // display the data
			}else if(me.parentNode.childNodes[i].title){ // find all of the other "Data" related to tabs

				if(me.parentNode.childNodes[i].title.search("_Data") != -1){ // filter out the one that matches the one the user picked
					me.parentNode.childNodes[i].style.display = "none"; // "hide" the other related data
				}	
			}			
		}
	}
}

/* END: [Tab Switch Function] */


function MM_openBrWindow(theURL,winName,features){ //v2.0
  window.open(theURL,winName,features);
}

function closeMessage(){
document.getElementById('dqbanner').style.display='none';
}



/******************************************/

adTime=9.5;  // seconds ad reminder is shown
chanceAd=1; // ad will be shown 1 in X times (put 1 for everytime)

var ns=(document.layers);
var ie=(document.all);
var w3=(document.getElementById && !ie);
var calunit=ns? "" : "px"
adCount=0;
function initAd(){
	if(!ns && !ie && !w3) return;
	if(ie)		adDiv=eval('document.all.closeMessage.style');
	else if(ns)	adDiv=eval('document.layers["closeMessage"]');
	else if(w3)	adDiv=eval('document.getElementById("closeMessage").style');
	randAd=Math.ceil(Math.random()*chanceAd);
        if (ie||w3)
        adDiv.visibility="visible";
        else
        adDiv.visibility ="show";
	if(randAd==1) showAd();
}
function showAd(){
if(adCount<adTime*10){adCount+=1;
	if (ie){documentWidth  =truebody().offsetWidth/2+truebody().scrollLeft-10;
	documentHeight =truebody().offsetHeight/2+truebody().scrollTop-0;}	
	else if (ns){documentWidth=window.innerWidth/2+window.pageXOffset-0;
	documentHeight=window.innerHeight/2+window.pageYOffset-0;} 
	else if (w3){documentWidth=self.innerWidth/2+window.pageXOffset-0;
	documentHeight=self.innerHeight/2+window.pageYOffset-0;} 
	adDiv.left=documentWidth-0+calunit;adDiv.top =documentHeight-0+calunit;
	setTimeout("showAd()",100);}else closeAd();
}
function closeAd(){
if (ie||w3)
adDiv.display="none";
else
adDiv.visibility ="hide";
}

function truebody(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}




