if(document.all)// IE
{
	document.write('<link rel="stylesheet" href="css/serchresult_ie.css" type="text/css"  />');	
}
else 
{	
	document.write('<link rel="stylesheet" href="css/serchresult_fx.css" type="text/css"  />');
}
// Global variable to be used inside of call handlers.
// Note that this mirrors the property in the options object, but is
// here so that it can be used in onChange handlers written
// directly into the element declaration.
var pulldown_call_level = 0;

// Function that returns a newly created request object
// Use this function in any javascript that requires AJAX capabilities
function createRequest(){
  var request = false;
  try {
    request = new XMLHttpRequest();
  } catch (trymicrosoft) {
    try {
      request = new ActiveXObject("Msxml2.XMLHTTP");
    } catch (othermicrosoft) {
      try {
        request = new ActiveXObject("Microsoft.XMLHTTP");
      } catch (failed) {
        request = false;
      }
    }
  }
  return request;
}

// Array push workaround:
//   the following allows us to emulate a JavaScript array's push() method
//   in IE browsers below 5.5
//   taken from:
//     http://www.samspublishing.com/articles/article.asp?p=30111&seqNum=3
function Array_push() {
  var A_p = 0;
  for (A_p = 0; A_p < arguments.length; A_p++) {
    this[this.length] = arguments[A_p];
  }
  return this.length
}

if (typeof Array.prototype.push == "undefined") {
  Array.prototype.push = Array_push;
}
// end Array push workaround

function popup(url,windowname,width,height,features,doblur) {
  if (window.name == windowname) {
    window.location.href = url;
    window.resizeTo(width, height);
  } else {
    var ix = 0;
    var iy = 0;
    if (screen.width)  // Object guarding - is it supported?
      ix = screen.width/2 - width/2;
    if (screen.height)  // Object guarding - is it supported?
      if (features == "all") {
        iy = 10  //to account for all the vertical space added by address bar, etc.
      } else {
        iy = screen.height/2 - height/2;
      }
    var strFeatures = "";
    if (typeof(features) == "undefined"){
      strFeatures = ",resizable=1,scrollbars=1,left=" + ix + ",top=" + iy;
    } else if (features == "all"){
      strFeatures = ",resizable=1,scrollbars=1,toolbar=1,menubar=1,location=1,status=1,left=" + ix + ",top=" + iy;
    } else if (features == "none"){
      strFeatures = ",left=" + ix + ",top=" + iy;
    } else {
      strFeatures = "," + features;
    }
    var handle = window.open(url, windowname, 'width=' + width + ',height=' + height + strFeatures);
    if (!handle.opener) handle.opener = self;
    if(doblur){
       handle.blur();
    } else {
       handle.focus();
    }
  }
}

// This allows us to scroll to any html element.  The element must be
// passed in by id.
function scroll_to_element (id, debug) {
  var element = top.document.getElementById(id);
  if (null == element) {
    if (null != debug)
      top.alert("No element " + id + " found, cannot scroll to it");
    return;
  }
  element.scrollIntoView(true);
}

function targetparent_and_close(url) {
  self.opener.location.href=url;
  window.close();
}

function doFocus(){
  window.focus();
}

// From: http://tech.irt.org/articles/js016/
function Get_Cookie(name) {
  var start = document.cookie.indexOf(name + '=');
  var len = start + name.length + 1;
  if ((!start) && (name != document.cookie.substring(0,name.length)))
    return null;
  if (start == -1)
    return null;
  var end = document.cookie.indexOf(';',len);
  if (end == -1) end = document.cookie.length;
  return unescape(document.cookie.substring(len,end));
}

function Set_Cookie(name, value, path) {
  if (! path) {
    path = '/';
  }
  document.cookie = name + '=' + escape (value) + '; path=' + path;
}

//
// Takes the name of a text form element and the name of a pulldown.
// Add actions to both that causes setting the pulldown to set the
// text element, and typing into the text element to scroll through
// the pulldown.
//
function mirror_text_pulldown (text_name, pulldown_name) {

  var text_handler = find_form_element(text_name).onkeyup;
  var pulldown_handler = find_form_element(pulldown_name).onchange;
  var pulldown_rewrite = find_form_element(pulldown_name).on_rewrite;

  // Variables used to communicate data privately between handlers
  var name_index = {};
  var outside_onkeyup = true;

  // Handlers.
  find_form_element(pulldown_name).onchange = function (event, options) {
    if (outside_onkeyup) {
      var selected = find_form_element(pulldown_name).options[find_form_element(pulldown_name).selectedIndex];
      find_form_element(text_name).value = selected.text;
    }
    if (null != pulldown_handler)
      pulldown_handler(event, options);
  };

  find_form_element(pulldown_name).on_rewrite = function (event, options) {
    name_index = {};

    find_form_element(pulldown_name).index_elements(0);
    if (null != pulldown_rewrite)
      pulldown_rewrite(event, options);
  };

  // This is broken out here in chunks of 50 because it
  // massively improves interactivity on IE on Windows.
  // On Mozilla you can run through a few thousand in a
  // fraction of a second but...
  find_form_element(pulldown_name).index_elements = function (i) {
    var limit = i + 50;
    var pulldown_element = find_form_element(pulldown_name);
    if (pulldown_element.options.length < limit)
      limit = pulldown_element.options.length;
    for (var j = i; j < limit; j++) {
      var name = pulldown_element.options[j].text.toLowerCase();
      for (var len = 0; len <= name.length; len++) {
        var substring = name.substr(0, len);
        if (null == name_index[substring])
          name_index[substring] = j;
      }
    }

    // And try to fill in the pulldown if you can right now.
    if (find_form_element(text_name).value.length)
      find_form_element(text_name).onkeyup();

    if (j < pulldown_element.options.length)
      top.setTimeout(
        "find_form_element('" + pulldown_name + "').index_elements(1+" + j + ")",
        0
      );
  }



  find_form_element(text_name).onkeyup = function (event, options) {
    var i = name_index[find_form_element(text_name).value.toLowerCase()];
    if (null != i && find_form_element(pulldown_name).selectedIndex != i) {
      find_form_element(pulldown_name).selectedIndex = i;
      // This strategy is because the onchange handler that I set
      // might not be the current onchange handler!  I don't want
      // the one that I set to do anything because then you get
      // into deep recursion.
      outside_onkeyup = false;
      find_form_element(pulldown_name).onchange(event, options);
      outside_onkeyup = true;
    }
    if (null != text_handler)
      text_handler(event, options);
  };

  // This makes the rewrite run in the background on Windows to speed the
  // page load.

  top.setTimeout("find_form_element('" + pulldown_name + "').on_rewrite()", 5);
}


//
// Takes an anonymous array of names of pulldown elements and
// a nested_options (see "create_option_tree" for a description of
// what that looks like) and then sets appropriate handlers to
// create a cascading set of pulldown menus.  Does NOT handle
// multiple selections.  It does properly wrap any existing
// handlers.  It expects the relevant form elements to already
// exist.
//
function make_pulldown_group (pulldowns, nested_options) {
  var first_pulldown = find_form_element(pulldowns[0]);

  // Populate the first
  var option_tree = create_option_tree(pulldowns.length, nested_options);
  if ("string" == typeof option_tree) {
    alert(option_tree);
    return;
  }
  set_options(first_pulldown, option_tree);

  // Set on change handlers
  for (var i = 1; i < pulldowns.length; i++) {
    set_nested_pulldown_handler(pulldowns[i-1], pulldowns[i]);
  }

  // Make the last call work
  var last_pulldown = find_form_element(pulldowns[pulldowns.length - 1]);
  var last_handler = last_pulldown.onchange;
  last_pulldown.onchange = function (event, options) {
    if (null != last_handler) {
      if (null == options)
        options = {}
      if (null == options.pulldown_call_level)
        options.pulldown_call_level = 0;
      pulldown_call_level = options.pulldown_call_level;
      last_handler(event, options);
      pulldown_call_level = 0;
    }
  };

  // Populate the rest.
  first_pulldown.onchange();
}

// The depth is how many more levels the tree has.
// The tree is just an array of objects as below
//
//   [
//     {
//       value: "foo",
//       text: "bar",     // defaults to value
//       selected: true,  // defaults to false
//       sub_tree: [      // omit on the last level
//         ...
//       ],
//     },
//     { ... },
//     ...
//   ]
//
//
// If the tree is as expected it returns an array of Options
// with the subtrees embedded in the Options.
//
function create_option_tree (depth, nested_options) {
  depth--;
  if ((null == nested_options)
    || (null == nested_options.length)
  ) return("(expected another level)");
  var option_tree = [];
  for (var i = 0; i < nested_options.length; i++) {
    var info = nested_options[i];
    if (null == info)          // Happens on IE from picky commas
      break;

    var value = info["value"];
    if (null == value)
      return("(Option " + i + " is missing the value)");

    var text = info.text;
    if (null == text)
      text = value;

    var selected = info.selected;
    if (null == selected)
      selected = false;
    else if (false == selected)
      selected = false;
    else
      selected = true;


    var this_option = new Option(text, value, selected);
    if (0 < depth) {
      var sub_choices = create_option_tree(depth, info.nested_options);
      if ("string" == typeof sub_choices)
        return("[ " + value + " ]" + sub_choices);
      this_option.sub_tree = sub_choices;
    } else if (null != info.nested_options)
      return("[ " + value + " ](extra depth here)");

    option_tree.push(this_option);
  }
  return option_tree;
}

// Takes the name of a form element.  Searches all forms in the top
// page for form elements named that.  Returns the first form element
// object with that element.
function find_form_element (name) {
  var forms_array = top.document.forms;
  for (var i = 0; i < forms_array.length; ++i)
    if (null != forms_array[i][name])
      return forms_array[i][name];
  alert("Cannot find form with " + name + " in it");
}

// Takes the name of the input text form, and the default
// text value, and if the default text value is in the input
// text field, it clears it.  Use this in conjonction with
// onMouseover to clear and reinsert for example "Enter City" etc...
// See also set_default_text below.
function clear_default_text (input_text_name, default_value, do_focus) {
  var input_text = find_form_element(input_text_name);
  if(input_text.value.length > 0 &&
     default_value.length > 0 &&
     input_text.value == default_value) {
     input_text.value = '';
     if(do_focus){
       input_text.focus();
     }
  }
}
function set_default_text (input_text_name, default_value) {
  var input_text = find_form_element(input_text_name);
  if(input_text.value.length == 0 &&
     default_value .length > 0 &&
     input_text.value != default_value){
     input_text.value = default_value;
  }
}

//
// Used by make_multiple_pulldown to set the handlers.
// BUG ALERT: It is important the the closure is created in a
//  function!  "Lexical" variables in JavaScript are closed
//  over the scope of the innermost function call, and (unlike
//  in other languages) not over loops etc.
//
function set_nested_pulldown_handler (parent_name, child_name) {
  var parent_handler = find_form_element(parent_name).onchange;
  find_form_element(parent_name).onchange = function (event, options) {
    var parent = find_form_element(parent_name);
    var child = find_form_element(child_name);
    if (null == options)
      options = {};
    if (null == options.pulldown_call_level)
      options.pulldown_call_level = 0;
    if (null != parent_handler) {
      pulldown_call_level = options.pulldown_call_level;
      parent_handler(event, options);
    }
    var sub_tree = [];
    if (0 < parent.options.length) {
      var selection = parent.selectedIndex;
      if (-1 == selection)
        selection = 0;
      sub_tree = parent.options[selection].sub_tree;
    }

    options.pulldown_call_level++;
    pulldown_call_level = options.pulldown_call_level;
    set_options(child, sub_tree, event, options);
    child.onchange(event, options);
    pulldown_call_level = 0;
  };
}

//
// Takes a pulldown element and an array of Option objects.
// Sets the list of pulldowns in the element to that array.
// Yes, we need the actual objects, not names/values.
//
function set_options (form_element, option_list, event, options) {
  var opts = form_element.options;
  opts.length = 0;
  // An IE bug does not set Option.selected if defaultSelected is set,
  // and you cannot set selected directly on the Option (even though
  // JavaScript 1.1 says that you should be able to).  Therefore we have
  // to track both what is selected and what should be selected by
  // default.
  var selected_index = -1;
  var default_selected_index = 0;
  // Known bug causes "floating element bug" on Debian Mozilla
  // only if the pulldown has been used.  Not planning to fix.
  if ((0 == option_list.length))
    form_element.setAttribute("disabled", true);
  else {
    for (var i in option_list) {
      opts[i] = option_list[i];
      if (option_list[i].selected)
        selected_index = i;
      if (option_list[i].defaultSelected)
        default_selected_index = i;
    }
    form_element.removeAttribute("disabled");
    if (-1 == selected_index)
      selected_index = default_selected_index;
    form_element.selectedIndex = selected_index;
    // alert("Setting " + form_element.name + " to entry " + selected_index);
  }
  if (null != form_element.on_rewrite)
    form_element.on_rewrite(event, options);
}

// Make a form only submit once in a given time.  If no time is passed, it
// defaults to disabling the form for 1 second.
function set_submit_only_once(form_name, timeout, current_submit) {
  if(!form_name || !window.document.forms[form_name]){
    return;
  }
  if (null == timeout)
    timeout = 1;
  var submitted_at;
  window.document.forms[form_name].onsubmit = function(event,options) {
    if (
      (null != submitted_at)
      && (submitted_at.getTime() > (new Date()).getTime() - 1000*timeout)
    ) {
      return false;
    }
    else {
      submitted_at = new Date();
      if (null == current_submit)
        return true;
      else
        return current_submit();
    }
  };

}

// change a select list's options based on the click of a radio button
function change_dropdown_options_from_radio(form_name, dropdown_name, newoptionlist, oldoptionlist, save_selection) {
  var forms_array = top.document.forms;
  var form;
  for (var i = 0; i < forms_array.length; ++i) {
    if (forms_array[i].id == form_name) {
      form = forms_array[i];
    }
  }
  var dropdown;
  for (var i=0; i < form.elements.length; ++i) {
    if (form.elements[i].name == dropdown_name) {
      dropdown = form.elements[i];
    }
  }

  var old_index = dropdown.selectedIndex;
  var old_text  = oldoptionlist[old_index].text;

  var option_tree = create_option_tree(0, newoptionlist);
  set_options(dropdown,option_tree);

  if (save_selection) {
    var new_index = 0;
    for (var i=0; i < dropdown.length; ++i) {
      if ((i <= newoptionlist.length) && (newoptionlist[i].text == old_text)) {
        new_index = i;
      }
    }
    dropdown.selectedIndex = new_index;
  }

}

// given a form and dropdown name, goto the value of the dropdown's
// selected element
function goto_dropdown_value(form, dropdown_name) {
  var dropdown;
  for (var i=0; i < form.elements.length; ++i) {
    if (form.elements[i].name == dropdown_name) {
      dropdown = form.elements[i];
    }
  }
  document.location = unescape(dropdown.value);
}

// takes in the name of a select-list, returns its value
function get_selectlist_value(element_name) {
  var element = find_form_element(element_name);
  var selectedIndex = element.selectedIndex;
  if (element && selectedIndex >= 0 && selectedIndex < element.options.length){
    return element.options[selectedIndex].value;
  }
  return null;
}

// iterates through radio buttons in group and gets the selected value
// takes in the form name, radio group name and returns to value of the radio button clicked
function getRadioVal(formName, radioGroup) {
  var group = document[formName][radioGroup];
  for (var i=0; i < group.length; i++) {
    if (group[i].checked) {
      return group[i].value;
    }
  }
}

// taken from: http://www.alistapart.com/articles/tableruler/
function apply_table_ruler(table_class,tr_ruled_class) {
  if ( !table_class ) {
    table_class = 'ruler';
  }
  if ( !tr_ruled_class ) {
    tr_ruled_class = 'ruled';
  }
  if (document.getElementById && document.createTextNode) {
    var tables=document.getElementsByTagName('table');
    for (var i=0,table; table = tables[i]; i++) {
      if(table.className==table_class) {
        var trs=table.getElementsByTagName('tr');
        for(var j=0,row; row=trs[j]; j++) {
          var parentName = row.parentNode.nodeName;
          if(parentName=='TBODY' && parentName!='TFOOT') {
            row.onmouseover=function(){this.className=tr_ruled_class;return false}
            row.onmouseout=function(){this.className='';return false}
          }
        }
      }
    }
  }
}

// this function takes in two values: a parentID, and a newElementID.
// it hides all child elements of the parentID, execpt the new element,
// which it shows
function swapElements(parentID, newElementID) {
  var parent = document.getElementById(parentID);
  if (!parent) {
    return null;
  }
  var children = parent.childNodes;
  for (var i=0; i < children.length; i++) {
    var child = children[i];
    if (child.innerHTML) {
      if(child.id == newElementID) {
        child.style.display = 'block';
      } else {
        child.style.display = 'none';
      }
    }
  }
}

///////////////////////////////////////////////////////////

function jsFFTextFieldFocus(inFFFormName, inFFFieldName, inFFDefaultValue){
  var oField;
  var strFieldValue;

  oField = document.forms[inFFFormName].elements[inFFFieldName];
  strFieldValue = oField.value;

  if (strFieldValue == inFFDefaultValue ){
    oField.value = "";
  }
}

function jsFFTextFieldBlur(inFFFormName, inFFFieldName, inFFDefaultValue){
  var oField;
  var strFieldValue;

  oField = document.forms[inFFFormName].elements[inFFFieldName];
  strFieldValue = oField.value;

  if (strFieldValue == ""){
    oField.value = inFFDefaultValue;
  }
}

// Function to trim whitespaces and carriage return from a string
function Trim(s) {
  // Remove leading spaces and carriage returns
  while ((s.substring(0,1) == ' ') || (s.substring(0,1) == '\n') || (s.substring(0,1) == '\r')){
    s = s.substring(1,s.length);
  }
  // Remove trailing spaces and carriage returns
  while ((s.substring(s.length-1,s.length) == ' ') || (s.substring(s.length-1,s.length) == '\n') || (s.substring(s.length-1,s.length) == '\r')){
    s = s.substring(0,s.length-1);
  }
  return s;
}

// Tell me if this string is an INT or not
function isInt (str){
  var i = parseInt (str);
  if (isNaN (i)) return false;
  i = i . toString ();
  if (i != str) return false;
  return true;
}

function getObj(name) {
  if (document.getElementById) {
    this.obj = document.getElementById(name);
    this.style = document.getElementById(name).style;
  } else if (document.all) {
    this.obj = document.all[name];
    this.style = document.all[name].style;
  } else if (document.layers) {
    this.obj = document.layers[name];
    this.style = document.layers[name];
  }
}


function dropDIV(divIDin) {
  var divID = parent.document.getElementById([divIDin]);
  divID.style.visibility='hidden';
}

function openDIV(divIDin) { // open div
  var divID = document.getElementById([divIDin]);
  divID.style.visibility='visible';
}

// Focus cursor on first form field
function firstFocus() {
  for (var i = 0; i < document.forms.length; ++i)	{
    var f = document.forms[i];
    for (var j = 0; j < f.elements.length; ++j) {
      try {
        if (f.elements[j].type == 'text' || f.elements[j].type == 'textarea' || f.elements[j].type == 'radio' || f.elements[j].type == 'checkbox' || f.elements[j].type == 'select') {
          f.elements[j].focus();
          return;
        }
      }
      // If there was an error, check if it was because the form element
      // doesn't accept focus events (the number and message were
      // empirically pulled from IE), and either move to the next element
      // if it won't accept focus or rethrow the error if it was caused
      // by something else.
      catch (error) {
        var focus_error_number = -2146826178;
        var focus_error_message = "Can't move focus to the control because it is invisible, not enabled, or of a type that does not accept the focus.";
        if (
            error.number != focus_error_number
            && error.description != focus_error_message
            && error.message != focus_error_message
           )
        {
          throw error;
        }
      }
    }
  }
}

// dynamically load external JS files using DHTML
function dhtmlLoadScript(url) {
  var theJSScript = document.createElement("script");
  theJSScript.src = url;
  theJSScript.type="text/javascript";
  document.getElementsByTagName("head")[0].appendChild(theJSScript);
}

// browser proof method to get dom object
function $(obj) {
  if (document.getElementById) return document.getElementById(obj);
  else if (document.all) return document.all[obj];
  else if (document.layers) return document.layers[obj];
}


// Class that allows multiple window.onload handlers.
function InitStack() {
}
InitStack.stack = [];
InitStack.addFunction = function(func) {
  InitStack.stack.push(func);
}
InitStack.init = function() {
  for (var i = 0; i < InitStack.stack.length; i++) {
    InitStack.stack[i]();
  }
}


//Country list
var country = '\
AF:Afghanistan|\
AL:Albania|\
DZ:Algeria|\
AS:American Samoa|\
AD:Andorra|\
AO:Angola|\
AI:Anguilla|\
AQ:Antarctica|\
AG:Antigua and Barbuda|\
AR:Argentina|\
AM:Armenia|\
AW:Aruba|\
AU:Australia|\
AT:Austria|\
AZ:Azerbaijan|\
AP:Azores|\
BS:Bahamas|\
BH:Bahrain|\
BD:Bangladesh|\
BB:Barbados|\
BY:Belarus|\
BE:Belgium|\
BZ:Belize|\
BJ:Benin|\
BM:Bermuda|\
BT:Bhutan|\
BO:Bolivia|\
BA:Bosnia And Herzegowina|\
XB:Bosnia-Herzegovina|\
BW:Botswana|\
BV:Bouvet Island|\
BR:Brazil|\
IO:British Indian Ocean Territory|\
VG:British Virgin Islands|\
BN:Brunei Darussalam|\
BG:Bulgaria|\
BF:Burkina Faso|\
BI:Burundi|\
KH:Cambodia|\
CM:Cameroon|\
CA:Canada|\
CV:Cape Verde|\
KY:Cayman Islands|\
CF:Central African Republic|\
TD:Chad|\
CL:Chile|\
CN:China|\
CX:Christmas Island|\
CC:Cocos (Keeling) Islands|\
CO:Colombia|\
KM:Comoros|\
CG:Congo|\
CD:Congo, The Democratic Republic O|\
CK:Cook Islands|\
XE:Corsica|\
CR:Costa Rica|\
CI:Cote d` Ivoire (Ivory Coast)|\
HR:Croatia|\
CU:Cuba|\
CY:Cyprus|\
CZ:Czech Republic|\
DK:Denmark|\
DJ:Djibouti|\
DM:Dominica|\
DO:Dominican Republic|\
TP:East Timor|\
EC:Ecuador|\
EG:Egypt|\
SV:El Salvador|\
GQ:Equatorial Guinea|\
ER:Eritrea|\
EE:Estonia|\
ET:Ethiopia|\
FK:Falkland Islands (Malvinas)|\
FO:Faroe Islands|\
FJ:Fiji|\
FI:Finland|\
FR:France (Includes Monaco)|\
FX:France, Metropolitan|\
GF:French Guiana|\
PF:French Polynesia|\
TA:French Polynesia (Tahiti)|\
TF:French Southern Territories|\
GA:Gabon|\
GM:Gambia|\
GE:Georgia|\
DE:Germany|\
GH:Ghana|\
GI:Gibraltar|\
GR:Greece|\
GL:Greenland|\
GD:Grenada|\
GP:Guadeloupe|\
GU:Guam|\
GT:Guatemala|\
GN:Guinea|\
GW:Guinea-Bissau|\
GY:Guyana|\
HT:Haiti|\
HM:Heard And Mc Donald Islands|\
VA:Holy See (Vatican City State)|\
HN:Honduras|\
HK:Hong Kong|\
HU:Hungary|\
IS:Iceland|\
IN:India|\
ID:Indonesia|\
IR:Iran|\
IQ:Iraq|\
IE:Ireland|\
EI:Ireland (Eire)|\
IL:Israel|\
IT:Italy|\
JM:Jamaica|\
JP:Japan|\
JO:Jordan|\
KZ:Kazakhstan|\
KE:Kenya|\
KI:Kiribati|\
KP:Korea, Democratic People\'S Repub|\
KW:Kuwait|\
KG:Kyrgyzstan|\
LA:Laos|\
LV:Latvia|\
LB:Lebanon|\
LS:Lesotho|\
LR:Liberia|\
LY:Libya|\
LI:Liechtenstein|\
LT:Lithuania|\
LU:Luxembourg|\
MO:Macao|\
MK:Macedonia|\
MG:Madagascar|\
ME:Madeira Islands|\
MW:Malawi|\
MY:Malaysia|\
MV:Maldives|\
ML:Mali|\
MT:Malta|\
MH:Marshall Islands|\
MQ:Martinique|\
MR:Mauritania|\
MU:Mauritius|\
YT:Mayotte|\
MX:Mexico|\
FM:Micronesia, Federated States Of|\
MD:Moldova, Republic Of|\
MC:Monaco|\
MN:Mongolia|\
MS:Montserrat|\
MA:Morocco|\
MZ:Mozambique|\
MM:Myanmar (Burma)|\
NA:Namibia|\
NR:Nauru|\
NP:Nepal|\
NL:Netherlands|\
AN:Netherlands Antilles|\
NC:New Caledonia|\
NZ:New Zealand|\
NI:Nicaragua|\
NE:Niger|\
NG:Nigeria|\
NU:Niue|\
NF:Norfolk Island|\
MP:Northern Mariana Islands|\
NO:Norway|\
OM:Oman|\
PK:Pakistan|\
PW:Palau|\
PS:Palestinian Territory, Occupied|\
PA:Panama|\
PG:Papua New Guinea|\
PY:Paraguay|\
PE:Peru|\
PH:Philippines|\
PN:Pitcairn|\
PL:Poland|\
PT:Portugal|\
PR:Puerto Rico|\
QA:Qatar|\
RE:Reunion|\
RO:Romania|\
RU:Russian Federation|\
RW:Rwanda|\
KN:Saint Kitts And Nevis|\
SM:San Marino|\
ST:Sao Tome and Principe|\
SA:Saudi Arabia|\
SN:Senegal|\
XS:Serbia-Montenegro|\
SC:Seychelles|\
SL:Sierra Leone|\
SG:Singapore|\
SK:Slovak Republic|\
SI:Slovenia|\
SB:Solomon Islands|\
SO:Somalia|\
ZA:South Africa|\
GS:South Georgia And The South Sand|\
KR:South Korea|\
ES:Spain|\
LK:Sri Lanka|\
NV:St. Christopher and Nevis|\
SH:St. Helena|\
LC:St. Lucia|\
PM:St. Pierre and Miquelon|\
VC:St. Vincent and the Grenadines|\
SD:Sudan|\
SR:Suriname|\
SJ:Svalbard And Jan Mayen Islands|\
SZ:Swaziland|\
SE:Sweden|\
CH:Switzerland|\
SY:Syrian Arab Republic|\
TW:Taiwan|\
TJ:Tajikistan|\
TZ:Tanzania|\
TH:Thailand|\
TG:Togo|\
TK:Tokelau|\
TO:Tonga|\
TT:Trinidad and Tobago|\
XU:Tristan da Cunha|\
TN:Tunisia|\
TR:Turkey|\
TM:Turkmenistan|\
TC:Turks and Caicos Islands|\
TV:Tuvalu|\
UG:Uganda|\
UA:Ukraine|\
AE:United Arab Emirates|\
UK:United Kingdom|\
GB:Great Britain|\
US:United States|\
UM:United States Minor Outlying Isl|\
UY:Uruguay|\
UZ:Uzbekistan|\
VU:Vanuatu|\
XV:Vatican City|\
VE:Venezuela|\
VN:Vietnam|\
VI:Virgin Islands (U.S.)|\
WF:Wallis and Furuna Islands|\
EH:Western Sahara|\
WS:Western Samoa|\
YE:Yemen|\
YU:Yugoslavia|\
ZR:Zaire|\
ZM:Zambia|\
ZW:Zimbabwe|\
';

defaultCountry='NG';
function populateCountry(idName) {

   var countryLineArray = country.split('|');      // Split into lines

   var selObj = document.getElementById( idName );

   selObj.options[0] = new Option('Select Country','');
   selObj.selectedIndex = 0;
   for (var loop = 0; loop < countryLineArray.length; loop++) {

      lineArray = countryLineArray[loop].split(':');

      countryCode  = TrimString(lineArray[0]);
      countryName  = TrimString(lineArray[1]);
   
      if ( countryCode != '' ) {
 		 selObj.options.length=loop+1;
         selObj.options[loop + 1] = new Option(countryName, countryCode);
      }

      if ( defaultCountry == countryCode ) {

         selObj.selectedIndex = loop + 1;
      }
   }
}
function TrimString(sInString) {
   
   if ( sInString ) {

      sInString = sInString.replace( /^\s+/g, "" );// strip leading
      return sInString.replace( /\s+$/g, "" );// strip trailing
   }
}

//Find current position and dimensions

function getScroll(){
		this.scrollY=0;
		this.scrollX=0;
      	if(typeof(window.pageYOffset) == 'number') {
        	this.scrollY = window.pageYOffset;
        	this.scrollX = window.pageXOffset;
      	} else if(document.body && (document.body.scrollLeft || document.body.scrollTop)) {
        	this.scrollY = document.body.scrollTop;
        	this.scrollX = document.body.scrollLeft;
      	} else if(document.documentElement && (document.documentElement.scrollLeft || document.documentElement.scrollTop)) {
        	this.scrollY = document.documentElement.scrollTop;
        	this.scrollX = document.documentElement.scrollLeft;
      	}

	}
	
//Show pop window for Image
function ShowPopWinImage(txt, title){
	if (!title){
		title='School n You.com: Alert';	
	}
	ndiv=document.getElementById('alertDIV');
	if (!ndiv){
		pdiv=document.createElement('div');
		pdiv.id='alertPrevInp';
		ndiv=document.createElement("div");
		ndiv.id='alertDIV';
		pdiv.appendChild(ndiv);
		document.body.appendChild(pdiv);
	}
	winwidth=700;
	winheight=400;
	ndiv.style.position='absolute';
	ndiv.style.height=winheight+'px';
	ndiv.style.width=winwidth+'px';
	ndiv.style.overflow='auto';
	ndiv.style.border='1px solid';
	ndiv.style.background='white';
	aryDim=new getScroll();
	pdiv.style.top=0;
	pdiv.style.left=0;
	pdiv.style.position='absolute';
	pd= new getPageDim()
	pdiv.style.width=pd.width-19;
	pdiv.style.height=pd.height;
	pdiv.style.backgroundImage='url(img/global/greyoverlay.png)';
	pdiv.style.innerHTML='&nbsp;';
	pdiv.style.border='1px solid black';
	ndiv.style.top=((aryDim.scrollY+(screen.availHeight-winheight)/5.5)).toString()+'px';
	ndiv.style.left=((aryDim.scrollX+(screen.availWidth-winwidth)/2))+'px';
	ndiv.innerHTML='<div class="SearchResultBlackHeader" style="float:left; width:98%;padding-top:2px;">&nbsp;'+title+'</div>\
				<div style="float:left; height:'+(winheight-75)+'px; padding:3px;overflow:auto;width:98%">'+txt+'</div>\
				<div style="text-align:center; width:98%"><input type="image" src="img/global/dialog_ok.gif"  style="width:86px; height:21px; border:0px" onclick="document.getElementById(\'alertPrevInp\').style.display=\'none\'"></div>';
	ndiv.style.display='block';
	pdiv.style.display='block';
}



//Show pop fro message
function ShowPopWin(txt, title){
	if (!title){
		title='School n You.com: Alert';	
	}
	ndiv=document.getElementById('alertDIV');
	if (!ndiv){
		pdiv=document.createElement('div');
		pdiv.id='alertPrevInp';
		ndiv=document.createElement("div");
		ndiv.id='alertDIV';
		pdiv.appendChild(ndiv);
		document.body.appendChild(pdiv);
	}
	winwidth=300;
	winheight=300;
	ndiv.style.position='absolute';
	ndiv.style.height=winheight+'px';
	ndiv.style.width=winwidth+'px';
	ndiv.style.overflow='auto';
	ndiv.style.border='1px solid';
	ndiv.style.background='white';
	aryDim=new getScroll();
	pdiv.style.top=0;
	pdiv.style.left=0;
	pdiv.style.position='absolute';
	pd= new getPageDim()
	pdiv.style.width=pd.width-19;
	pdiv.style.height=pd.height;
	pdiv.style.backgroundImage='url(img/global/greyoverlay.png)';
	pdiv.style.innerHTML='&nbsp;';
	pdiv.style.border='1px solid black';
	ndiv.style.top=((aryDim.scrollY+(screen.availHeight-winheight)/2.5)).toString()+'px';
	ndiv.style.left=((aryDim.scrollX+(screen.availWidth-winwidth)/2))+'px';
	ndiv.innerHTML='<div class="SearchResultBlackHeader" style="float:left; width:98%;padding-top:2px;">&nbsp;'+title+'</div>\
				<div style="float:left; height:'+(winheight-75)+'px; padding:3px;overflow:auto;width:98%">'+txt+'</div>\
				<div style="text-align:center; width:98%"><input type="image" src="img/global/dialog_ok.gif"  style="width:86px; height:21px; border:0px" onclick="document.getElementById(\'alertPrevInp\').style.display=\'none\'"></div>';
	ndiv.style.display='block';
	pdiv.style.display='block';
}
//Get complete page dimension
function getPageDim() {
		var xScroll, yScroll;
		if (window.innerHeight && window.scrollMaxY) {	
			xScroll = document.body.scrollWidth;
			yScroll = window.innerHeight + window.scrollMaxY;
		} else if (document.body.scrollHeight > document.body.offsetHeight){ 
			xScroll = document.body.scrollWidth;
			yScroll = document.body.scrollHeight;
		} else { 
			xScroll = document.body.offsetWidth;
			yScroll = document.body.offsetHeight;
		}
		var windowWidth, windowHeight;
		if (self.innerHeight) {	
			windowWidth = self.innerWidth;
			windowHeight = self.innerHeight;
		} else if (document.documentElement && document.documentElement.clientHeight) { 
			windowWidth = document.documentElement.clientWidth;
			windowHeight = document.documentElement.clientHeight;
		} else if (document.body) { 
			windowWidth = document.body.clientWidth;
			windowHeight = document.body.clientHeight;
		}	
		if(yScroll < windowHeight){
			pageHeight = windowHeight;
		} else { 
			pageHeight = yScroll;
		}

		if(xScroll < windowWidth){	
			pageWidth = windowWidth;
		} else {
			pageWidth = xScroll;
		}
		
		this.height = pageHeight;
		this.width = pageWidth;
	}