function getElementbyClass(classname,parent){
  var temparray=new Array()
  var inc=0
  var alltags=($(parent)||document).all? ($(parent)||document).all : ($(parent)||document).getElementsByTagName("*")
  for (var i=0; i<alltags.length; i++){
  if (alltags[i].className==classname)
    temparray[inc++]=alltags[i]
  }
  return temparray
}

function replaceall(checkMe,toberep,repwith){
  var temp = checkMe;
  var i = temp.indexOf(toberep);
  while(i > -1){
    temp = temp.replace(toberep, repwith);
    i = temp.indexOf(toberep);
  }
  return temp;
}

function getiframedoc(e){
      obj_iframe = $(e);
      if (obj_iframe.contentDocument) { // For NS6
        obj_iframe = obj_iframe.contentDocument; 
      } else if (obj_iframe.contentWindow) { // For IE5.5 and IE6
        obj_iframe = obj_iframe.contentWindow.document;
      } else if (obj_iframe.document) { // For IE5
        obj_iframe = obj_iframe.document;
      }
      return obj_iframe;
}

function appendload(func,obj){
  if ( typeof (obj||window).addEventListener != "undefined" ) { // DOM2
    (obj||window).addEventListener("load", func, false );
  } else if ( typeof (obj||window).attachEvent != "undefined" ) { // IE 
    (obj||window).attachEvent("onload", func);
  } else { // else
    if ( (obj||window).onload != null ) {
      var oldOnload = (obj||window).onload;
      (obj||window).onload = function ( e ) {
        oldOnload( e );
        func;
      };
    } else {
      (obj||window).onload = func;
    }
  }
}

function pause(numberMillis) {
  var now = new Date();
  var exitTime = now.getTime() + numberMillis;
  while (true) {
    now = new Date();
    if (now.getTime() > exitTime)
      return;
  }
}

function isnumeric(sText){
   var ValidChars = "0123456789.";
   var IsNumber=true;
   var Char;
   for (i = 0; i < sText.length && IsNumber == true; i++) 
      { 
      Char = sText.charAt(i); 
      if (ValidChars.indexOf(Char) == -1) 
         {
         IsNumber = false;
         }
      }
   return IsNumber;
}

function isboolean(astr) { 
   var isit='' 
   astr +=''
   if (astr == null || astr == '') isit= false
   else {
                    astr = astr.substring(0,1)     // just get first letter
                    astr = astr.toUpperCase()     // make it caps
                    if (astr != "T" && astr != "F") 
                         {
                              // unacceptable value entered
                              isit = false
                         }
                    else
                         //returns value which caller can test for true/
                            false
                         //without having to do substrings, etc.
                         isit= astr
   }
   //return is mixed:  can be either a boolean or a string.
   return isit
}

function getrandom(){
    var ranNum= Math.round(Math.random()*4);
    return ranNum;
}

function getOuterHTML(e){
  e = $(e);
  var id = document.createElement("DIV");
  var temp=e.cloneNode(true);
  //alert(temp.innerHTML);
  id.innerHTML += temp.outerHTML;
  outer=id.innerHTML;
  //Element.remove(id);
  return outer;
}

function adjustIFrameSize (e) {
  e = $(e);
  //if (e && !window.opera){
   // e.style.display="block";
    //obj_doc = getiframedoc(e);
    
    //e.style.height = obj_doc.scrollHeight + (obj_doc.offsetHeight - obj_doc.clientHeight);
    //e.style.width = obj_doc.scrollWidth + (obj_doc.offsetWidth - obj_doc.clientWidth);
    //return;
    
                    var h = "";
                    if (e.contentDocument) {//ns6 syntax
                    alert('test1');
      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
      e.height = e.contentDocument.body.offsetHeight+FFextraHeight;
      e.width = e.contentDocument.body.offsetWidth+FFextraHeight;
                        h = e.contentDocument.documentElement.offsetHeight + 20 + "px";
                       
                    } else if (e.contentWindow) {//ie5+ syntax
                     alert('test2');
                        h = e.contentWindow.document.body.scrollHeight + 5 + "px";
                    } else {
                    alert('test3');
                        return;
                    }
                    e.setAttribute("height",h);
                    e.parentNode.setAttribute("height",h);
    
    /*
    if (e.contentDocument && e.contentDocument.body.offsetHeight){ //ns6 syntax
      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
      e.height = e.contentDocument.body.offsetHeight+FFextraHeight;
      e.width = e.contentDocument.body.offsetWidth+FFextraHeight;
    }else if (e.Document && e.Document.body.scrollHeight){ //ie5+ syntax
      e.height = e.Document.body.scrollHeight;
      e.width = e.Document.body.scrollWidth;
    }
    */
 // }
}