var WS_MULTIPART_RESULT_WRAPPER="ws-multipart-result";executeOnEveryPage_header();function executeOnEveryPage_header(){urlArgs=getUrlArguments(window.location);var C=urlArgs["referrer"];var A=C?C:document.referrer;if(A!=""){referrer_current=getCookie("cookie_scart_referrer");if(referrer_current==null){setCookieAdvanced("cookie_scart_referrer",A,30,"/",null,null)}}var B=urlArgs["scart_affiliate_id"];if(B){setCookieAdvanced("cookie_scart_affiliate_id",B,1*365,"/",null,null)}}function executeOnEveryPage_bottom(B,H,D){if(document.getElementsByName){searchby_category_fields=document.getElementsByName("searchby_category");if(searchby_category_fields){for(var F=0;F<searchby_category_fields.length;F++){for(var E=1;E<searchby_category_fields[F].length;E++){if(searchby_category_fields[F].options[E].value==current_category_ids_path){searchby_category_fields[F].options[E].selected=true}}}}D=unescapePhp2JavaScriptArgument(D);dynamic_include_fields=getElementsByTagAndName("div","dynamic_include");if(dynamic_include_fields){var A="action=dynamicInclude";var C=new Array();for(var F=0;F<dynamic_include_fields.length;F++){if(D){dynamic_include_fields[F].innerHTML=D}C[dynamic_include_fields[F].id]=dynamic_include_fields[F];A+="&wsParams["+dynamic_include_fields[F].id+"]="+dynamic_include_fields[F].getAttribute("ajaxParams")}var G={success:function(K){var I=K.argument.targetFields;for(var J in I){setInnerHtmlByMultipartResult(K.responseText,I[J],null,true)}launchJavascript(K.responseText)},failure:function(K){var I=K.argument.targetFields;for(var J in I){I[J].innerHTML="Failed dynamicInclude ("+K.status+" "+K.statusText+")"}},argument:{targetFields:C}};YAHOO.util.Connect.asyncRequest("POST",B,G,A)}}}function f_add2wishlist_form(A){return f_add2wishlist_form_alias1(A,"0",false,"")}function f_add2wishlist_form_alias1(pid,rpid,isCheckOptions,msgSelectOption){if(isCheckOptions){eval("form = this.document.add2cart_form_"+pid+";");objectProductTotals=rpid>0?recalculate_product_price_total_2(form,"_arr["+rpid+"]"):recalculate_product_price_total(form);if(objectProductTotals&&!objectProductTotals.isProductReadyToOrder()){alert(msgSelectOption);return false}if(objectProductTotals&&!objectProductTotals.isProductReadyToOrderRequired()){alert(msgSelectOption);return false}}action_value="add2wishlist";add2cartForm=document.forms["add2cart_form_"+pid];scart_referrer=getCookie("cookie_scart_referrer");scart_affiliate_id=getCookie("cookie_scart_affiliate_id");eval("this.document.add2cart_form_"+pid+".target = '';");if(add2cartForm.scart_referrer){eval("this.document.add2cart_form_"+pid+".scart_referrer.value = '"+(scart_referrer!=null?scart_referrer:"")+"';")}if(add2cartForm.scart_affiliate_id){eval("this.document.add2cart_form_"+pid+".scart_affiliate_id.value = '"+(scart_affiliate_id!=null?scart_affiliate_id:"")+"';")}if(add2cartForm.scart_url_hash&&location.hash!=null&&location.hash!=""){eval("this.document.add2cart_form_"+pid+".scart_url_hash.value = '"+location.hash+"';")}eval("this.document.add2cart_form_"+pid+".form_action_value.value = '"+action_value+"';");if(rpid>0){eval("this.document.add2cart_form_"+pid+".rpid.value = '"+rpid+"';")}eval("this.document.add2cart_form_"+pid+".submit();");return true}function f_move2cart_form(A){return f_move2cart_form_alias1(A,"0",false,"")}function f_move2cart_form_alias1(pid,rpid,isCheckOptions,msgSelectOption){if(isCheckOptions){eval("form = this.document.add2cart_form_"+pid+";");objectProductTotals=rpid>0?recalculate_product_price_total_2(form,"_arr["+rpid+"]"):recalculate_product_price_total(form);if(objectProductTotals&&!objectProductTotals.isProductReadyToOrder()){alert(msgSelectOption);return false}if(objectProductTotals&&!objectProductTotals.isProductReadyToOrderRequired()){alert(msgSelectOption);return false}}action_value="buy_only";if(document.getElementById){_scart_order_qty=document.getElementById("scart_order_qty");_scart_order_subtotal=document.getElementById("scart_order_subtotal");_scart_order_grandtotal=document.getElementById("scart_order_grandtotal");if(_scart_order_qty||_scart_order_subtotal||_scart_order_grandtotal){action_value="buy_only_special"}}add2cartForm=document.forms["add2cart_form_"+pid];onsubmitResult=add2cartForm.onsubmit();if((typeof (onsubmitResult)=="undefined")||onsubmitResult){window_move2cart=window.open("","win_move2cart","left=50,screenX=50,top=50,screenY=50,width=500,height=150,scrollbars=0,resizable=1");if(window.focus){window_move2cart.focus()}add2cartForm=document.forms["add2cart_form_"+pid];scart_referrer=getCookie("cookie_scart_referrer");scart_affiliate_id=getCookie("cookie_scart_affiliate_id");eval("this.document.add2cart_form_"+pid+".target = 'win_move2cart';");if(add2cartForm.scart_referrer){eval("this.document.add2cart_form_"+pid+".scart_referrer.value = '"+(scart_referrer!=null?scart_referrer:"")+"';")}if(add2cartForm.scart_affiliate_id){eval("this.document.add2cart_form_"+pid+".scart_affiliate_id.value = '"+(scart_affiliate_id!=null?scart_affiliate_id:"")+"';")}if(add2cartForm.scart_url_hash&&location.hash!=null&&location.hash!=""){eval("this.document.add2cart_form_"+pid+".scart_url_hash.value = '"+location.hash+"';")}eval("this.document.add2cart_form_"+pid+".form_action_value.value = '"+action_value+"';");if(rpid>0){eval("this.document.add2cart_form_"+pid+".rpid.value = '"+rpid+"';")}add2cartForm.submit()}return true}function f_add2cart_form(A){return f_add2cart_form_alias1(A,"0",false,"")}function f_add2cart_form_alias1(pid,rpid,isCheckOptions,msgSelectOption){if(isCheckOptions){eval("form = this.document.add2cart_form_"+pid+";");objectProductTotals=rpid>0?recalculate_product_price_total_2(form,"_arr["+rpid+"]"):recalculate_product_price_total(form);if(objectProductTotals&&!objectProductTotals.isProductReadyToOrder()){alert(msgSelectOption);return false}if(objectProductTotals&&!objectProductTotals.isProductReadyToOrderRequired()){alert(msgSelectOption);return false}}add2cartForm=document.forms["add2cart_form_"+pid];scart_referrer=getCookie("cookie_scart_referrer");scart_affiliate_id=getCookie("cookie_scart_affiliate_id");eval("this.document.add2cart_form_"+pid+".target = '';");if(add2cartForm.scart_referrer){eval("this.document.add2cart_form_"+pid+".scart_referrer.value = '"+(scart_referrer!=null?scart_referrer:"")+"';")}if(add2cartForm.scart_affiliate_id){eval("this.document.add2cart_form_"+pid+".scart_affiliate_id.value = '"+(scart_affiliate_id!=null?scart_affiliate_id:"")+"';")}if(add2cartForm.scart_url_hash&&location.hash!=null&&location.hash!=""){eval("this.document.add2cart_form_"+pid+".scart_url_hash.value = '"+location.hash+"';")}eval("this.document.add2cart_form_"+pid+".form_action_value.value = 'buy';");if(rpid>0){eval("this.document.add2cart_form_"+pid+".rpid.value = '"+rpid+"';")}onsubmitResult=add2cartForm.onsubmit();if((typeof (onsubmitResult)=="undefined")||onsubmitResult){add2cartForm.submit()}return true}function onsubmit_add2cart_form(A){if(typeof (onsubmit_add2cart)=="function"){onsubmitResult=onsubmit_add2cart(A);if(typeof (onsubmitResult)=="undefined"){return true}else{return onsubmitResult}}return true}function form_jumpbylocation(_location){if(_location!=""){var regexpr=new RegExp("^http[s]?://");var _locationFull=regexpr.test(_location)?_location:location_prefix+_location;eval("document.location='"+_locationFull+"'")}}function trim(C){if(typeof C!="string"){return C}var B=C;var A=B.substring(0,1);while(A==" "){B=B.substring(1,B.length);A=B.substring(0,1)}A=B.substring(B.length-1,B.length);while(A==" "){B=B.substring(0,B.length-1);A=B.substring(B.length-1,B.length)}while(B.indexOf("  ")!=-1){B=B.substring(0,B.indexOf("  "))+B.substring(B.indexOf("  ")+1,B.length)}return B}function getWinProps(A,C,B,E){var D=(screen.width-A)/2;var F=(screen.height-C)/2;winprops="left="+D+",screenX="+D+",top="+F+",screenY="+F+",width="+A+",height="+C+",scrollbars="+B+",resizable="+E;return winprops}function getElementsByTagAndName(A,B){var C=document.getElementsByTagName(A);var D=new Array();for(i=0,iarr=0;i<C.length;i++){if(C[i].getAttribute("name")==B){D[iarr]=C[i];iarr++}}return D}function launchJavascript(responseText){if(responseText&&responseText!=""){var ScriptFragment="(?:<script.*?>)((\\s|.)*?)(?:<\/script>)";var match=new RegExp(ScriptFragment,"gim");var scripts=responseText.match(match);if(scripts){var js="";for(var s=0;s<scripts.length;s++){var match=new RegExp(ScriptFragment,"im");js+=scripts[s].match(match)[1]}eval(js)}}}function getCookie(A){if(document.cookie.length>0){begin=document.cookie.indexOf(A+"=");if(begin!=-1){begin+=A.length+1;end=document.cookie.indexOf(";",begin);if(end==-1){end=document.cookie.length}return unescape(document.cookie.substring(begin,end))}}return null}function setCookie(C,D,A){var B=new Date();B.setTime(B.getTime()+(A*24*3600*1000));document.cookie=C+"="+escape(D)+((A==null)?"":"; expires="+B.toGMTString())}function setCookieAdvanced(D,F,A,H,E,G){var B=new Date();B.setTime(B.getTime()+(A*24*3600*1000));var C=D+"="+escape(F)+((A!=null)?"; expires="+B.toGMTString():"")+((H!=null)?"; path="+H:"")+((E!=null)?"; domain="+E:"")+((G!=null)?"; secure":"");document.cookie=C}function delCookie(A){if(getCookie(A)){document.cookie=A+"=; expires=Thu, 01-Jan-70 00:00:01 GMT"}}function checkCookiesEnabled(A){setCookie("scart_cookies_enabled","yes",1);if(getCookie("scart_cookies_enabled")=="yes"){delCookie("scart_cookies_enabled");return true}else{if(A!=""){alert(A)}}return false}function PartWrapperToggle(B,E){var F=null;if(document.getElementsByName){F=document.getElementsByName(B+"Body");var C=document.getElementsByName(B+"Up");var A=document.getElementsByName(B+"Down");if(F&&F.length>0){for(var D=0;D<F.length;D++){if(F[D].style.display=="none"){F[D].style.display="";A[D].style.display="none";C[D].style.display="";setCookieAdvanced("cookie_scart_"+B,1,5*365,"/",null,null)}else{F[D].style.display="none";A[D].style.display="";C[D].style.display="none";setCookieAdvanced("cookie_scart_"+B,1,-5*365,"/",null,null)}}}}if(E&&window.event){window.event.cancelBubble=true}return false}function ToggleByCookie(A){if(getCookie("cookie_scart_"+A)!=1){PartWrapperToggle(A,false)}}function recalculate_product_price_total_qty(B,A){return recalculate_product_price_total_qty_2(B,A,"")}function recalculate_product_price_total_qty_2(C,A,B){if(!C){return null}C["temp_qty_field_value"+B]=A.value;return recalculate_product_price_total_2(C,B)}function recalculate_product_price_total(A){return recalculate_product_price_total_2(A,"")}function recalculate_product_price_total_2(l,p){var W=null;if(!document.getElementById){return W}if(!l){return W}if(!l["product_id"+p]){return W}var h=l["product_id"+p].value;var J=0;var AA=0;var Z=0;var H=0;var O=0;var x=0;var B=0;var AB=0;var c=0;var z=0;var Y=0;var a=0;var F=0;var e=0;var AE=l["product_currency_digits"+p]?parseInt(l["product_currency_digits"+p].value):2;var g=document.getElementById("product_price_total_"+h);var v=document.getElementsByName("product_price_total_"+h);var C=document.getElementById("product_price_tax_total_"+h);var X=document.getElementsByName("product_price_tax_total_"+h);var L=document.getElementById("product_price_list_total_"+h);var AD=document.getElementsByName("product_price_list_total_"+h);var u=l["product_price_base"+p]?parseFloat(l["product_price_base"+p].value):0;var Q=l["product_price_list_base"+p]?parseFloat(l["product_price_list_base"+p].value):0;var s=l["include_base_price"+p]?l["include_base_price"+p].value:"yes";if(l["product_price_base"+p]){AA=s=="yes"?u:0}Z=AA;if(l["product_price_list_base"+p]){Z=s=="yes"?Q:0}var K=l["product_add_qty"+p];if(K&&K.type=="select-one"){J=K.options[K.selectedIndex].value}else{if(K&&K.length&&l["temp_qty_field_value"+p]){for(var y=0;y<K.length;y++){K[y].value=l["temp_qty_field_value"+p]}}J=K?parseInt(K.length?K[0].value:K.value):1}J=isNaN(J)?1:J;if(p!=""){var q=p.replace("[","\\[");q=q.replace("]","\\]");var d=new RegExp(q+"$")}var k=0;var m="";for(var y=0;y<l.elements.length;y++){if(d&&!d.test(l.elements[y].name)){continue}var n=l.elements[y].type;if(n!="hidden"){if(n=="checkbox"&&p==""){if(l.elements[y].checked){var T=new RegExp("^related_add2cart(_arr[[0-9]+])$");var G=T.exec(l.elements[y].name);if(G){var V=recalculate_product_price_total_2(l,G[1]);if(V!=null){H+=V.qty*V.total;O+=V.qty*V.total_list}}}}var D=new RegExp("^option_([0-9]+)_value"+(p!=""?"_arr":"$"));var P=D.exec(l.elements[y].name);if(!P){continue}var E=l["option_"+P[1]+"_qty"+p]?parseInt(l["option_"+P[1]+"_qty"+p].value):1;E=isNaN(E)?1:E;if(n=="checkbox"){c++;if(!l.elements[y].checked){continue}z++}else{if(n=="radio"){if(m!=l.elements[y].name){k=0;m=l.elements[y].name}Y++;k++;if(!l.elements[y].checked){continue}a++;var t=l["option_"+P[1]+"_qty"+p];if(t&&t.length){E=parseInt(t[k-1].value);E=isNaN(E)?1:E}}else{if(n=="select-one"){F++;var I=false;var A=unescape(l.elements[y].options[l.elements[y].selectedIndex].value);if(A==""){continue}if(A=="<required/>"){continue}var U=new RegExp("<price>[.0-9]+</price>");I=U.test(A);var S=new RegExp("<price value=[\"'][.0-9]+[\"']/>");I=I||S.test(A);if(I){e++}}}}x++;var r=unescape(l.elements[y].value);var AC=/<price>([0-9\.]+)<\/price>/i.exec(r);if(AC){AA+=E*parseFloat(AC[1])}AC=/<price value=.?([0-9\.]+).?\/>/i.exec(r);if(AC){AA+=E*parseFloat(AC[1])}var R=/<price_list value=.?([0-9\.]+).?\/>/i.exec(r);if(R){Z+=E*parseFloat(R[1])}}else{var D=new RegExp("^group_[0-9]+_required"+(p!=""?"":"$"));if(!D.test(l.elements[y].name)){continue}if(l.elements[y].value!="yes"){x=0;continue}B++;if(x>0){x=0;AB++}}}var o=J*AA+H;var f=J*Z+O;var b=o.toFixed(AE);if(v&&v.length>0){for(var y=0;y<v.length;y++){v[y].innerHTML=b}}else{if(g){g.innerHTML=b}}var N=f.toFixed(AE);if(AD&&AD.length>0){for(var y=0;y<AD.length;y++){AD[y].innerHTML=N}}else{if(L){L.innerHTML=N}}var w=l["product_taxinter_percent"+p]?parseInt(l["product_taxinter_percent"+p].value):0;var M=(o+o*(w/100)).toFixed(AE);if(X&&X.length>0){for(var y=0;y<X.length;y++){X[y].innerHTML=M}}else{if(C){C.innerHTML=M}}W=new ObjectProductTotals();W.setTotals(J,AA,Z);W.setCountRequired(B,AB);W.setCountCheckboxes(c,z);W.setCountRadiobuttons(Y,a);W.setCountDropdowns(F,e);return W}function radio_toggle(A){if(A.length){for(var B=0;B<A.length;B++){option_toggle(A[B])}}else{option_toggle(A)}}function option_toggle(A){if(A.checked){option_highlight(A)}else{option_unhighlight(A)}}function option_highlight(B){var A=null;if(B.parentNode&&B.parentNode.parentNode){A=B.parentNode.parentNode}else{if(B.parentElement&&B.parentElement.parentElement){A=B.parentElement.parentElement}}if(A){if(A.className=="product_options_body"){A.className="product_options_selected"}}}function option_unhighlight(B){var A=null;if(B.parentNode&&B.parentNode.parentNode){A=B.parentNode.parentNode}else{if(B.parentElement&&B.parentElement.parentElement){A=B.parentElement.parentElement}}if(A){if(A.className=="product_options_selected"){A.className="product_options_body"}}}function setAllFormFieldsWithSameNames(B){if(B&&B.form){fields=B.form[B.name];if(fields&&fields.length){for(var A=0;A<fields.length;A++){fields[A].value=B.value}}}}function populate_field_bytype(C,B){if(C.type=="file"||C.type=="text"||C.type=="textarea"){C.value=B}else{if(C.type=="select-one"){for(var A=0;A<C.length;A++){if(C[A].value==B){C[A].selected=true;break}}}else{if(C.type=="checkbox"||C.type=="radio"){C.checked=B!=""&&B!="0"?1:0}else{if(C.length){for(var A=0;A<C.length;A++){if(C[A].value==B){C[A].checked=true;break}}}}}}}function get_field_value_bytype(B,C){field_value="";if(B.type=="file"||B.type=="text"||B.type=="textarea"){field_value=B.value}else{if(B.type=="select-one"){field_value=B.value}else{if(B.type=="checkbox"||B.type=="radio"){field_value=B.checked?B.value:C}else{if(B.length){for(var A=0;A<B.length;A++){if(B.type=="select-multiple"){field_value=B[0].value;break}else{if(B[A].checked){field_value=B[A].value;break}}}}}}}return field_value}function set_focus_bytype(B){if(B.type=="text"||B.type=="textarea"){B.focus()}else{if(B.type=="checkbox"){B.focus()}else{if(B.type=="select-one"){B.focus()}else{if(B.type=="radio"){B.focus()}else{if(B.length){for(var A=0;A<B.length;A++){if(B[A].checked){B[A].focus();break}}}}}}}return field_value}function onmouseover_categorytype(B,C,A){}function onmouseout_categorytype(B,C,A){}function onmouseover_category(C,B,A){}function onmouseout_category(C,B,A){}function onmouseover_subcategory(B,A,C){}function onmouseout_subcategory(B,A,C){}function onimageload_categorytype(A){}function onimageload_category(A){}function onimageload_subcategory(A){}function selectOptionByCurrentPage(A,B){currentPath=window.location.pathname;currentPath=currentPath.substring(currentPath.lastIndexOf("/")+1);if(currentPath!=""){if(A[0][B]){for(j=0;j<A.length;j++){var C=A[j][B];for(i=1;i<C.length;i++){if(C.options[i].value.indexOf(currentPath)==0){C.options[i].selected=true;break}}}}else{if(A[B]){for(i=1;i<A[B].length;i++){if(A[B].options[i].value.indexOf(currentPath)==0){A[B].options[i].selected=true;break}}}}}}function setInnerHTMLById(A,C){if(document.getElementById){targetField=this.document.getElementById(A);targetField_arr=document.getElementsByName(A);if(targetField_arr&&targetField_arr.length>0){for(var B=0;B<targetField_arr.length;B++){targetField_arr[B].innerHTML=C}}else{if(targetField){targetField.innerHTML=C}}}}function unescapePhp2JavaScriptArgument(A){if(A){A=A.replace(/&quot;/g,'"');A=A.replace(/&#39;/g,"'")}return A}function setInnerHtmlByMultipartResult(C,E,B,A){if(!E){return }if(B==null){B=E.id}var D=getMultipartResultById(C,B);if(D==""){D=geWsErrorDescription(C,A)}if(D!=""||A){E.innerHTML=D}return D}function getMultipartResultById(D,B){var E="";var A="<"+WS_MULTIPART_RESULT_WRAPPER+' id="'+B+'">';var C="</"+WS_MULTIPART_RESULT_WRAPPER+">";var G=D.indexOf(A);if(G!=-1){var F=D.indexOf(C,G);E=D.substring(G+A.length,F)}return E}function geWsErrorDescription(E,D){var F="";var C=E.toLowerCase();var B="<error_descr>";var G="</error_descr>";var A=C.indexOf(B);if(A!=-1){var H=C.indexOf(G,A);F=E.substring(A+B.length,H)}else{if(D){F=E.replace(/<ws-multipart-result.*>[\s\S]*<\/ws-multipart-result>/gi,"")}}return F}var navTabNameSelected=new Array();function setSelectedNavTabName(B,A){navTabNameSelected[B]=A}function selectNavTabByName(B,A){return selectNavTabByNameWithSelectionClassNames(B,A,"navtab_selected","navtab_notselected")}function selectNavTabByNameWithSelectionClassNames(E,C,B,D){if(document.getElementById){if(navTabNameSelected[E]&&navTabNameSelected[E]!=""){field_arr=document.getElementsByName(navTabNameSelected[E]);if(field_arr&&field_arr.length>0){for(var A=0;A<field_arr.length;A++){field_arr[A].style.display="none"}}else{field=document.getElementById(navTabNameSelected[E]);if(field){field.style.display="none"}}field_arr=document.getElementsByName("a_"+navTabNameSelected[E]);if(field_arr&&field_arr.length>0){for(var A=0;A<field_arr.length;A++){field_arr[A].className=D}}else{field=document.getElementById("a_"+navTabNameSelected[E]);if(field){field.className=D}}}field_arr=document.getElementsByName(C);if(field_arr&&field_arr.length>0){for(var A=0;A<field_arr.length;A++){field_arr[A].style.display="block"}}else{field=document.getElementById(C);if(field){field.style.display="block"}}field_arr=document.getElementsByName("a_"+C);if(field_arr&&field_arr.length>0){for(var A=0;A<field_arr.length;A++){field_arr[A].className=B}}else{field=document.getElementById("a_"+C);if(field){field.className=B}}setCookieAdvanced("cookie_scart_"+E,C,1*365,"/",null,null);navTabNameSelected[E]=C}return false}function ObjectProductTotals(){this.qty=1;this.total=0;this.total_list=0;this.count_required=0;this.count_required_selected=0;this.count_checkboxes=0;this.count_checkboxes_selected=0;this.count_radiobuttons=0;this.count_radiobuttons_selected=0;this.count_dropdowns=0;this.count_dropdowns_selected=0}ObjectProductTotals.prototype.setTotals=function obj_pt_setTotals(C,B,A){this.qty=C;this.total=B;this.total_list=A};ObjectProductTotals.prototype.setCountRequired=function obj_pt_setRequired(A,B){this.count_required=A;this.count_required_selected=B};ObjectProductTotals.prototype.setCountCheckboxes=function obj_pt_setCountCheckboxes(B,A){this.count_checkboxes=B;this.count_checkboxes_selected=A};ObjectProductTotals.prototype.setCountRadiobuttons=function obj_pt_setCountRadiobuttons(A,B){this.count_radiobuttons=A;this.count_radiobuttons_selected=B};ObjectProductTotals.prototype.setCountDropdowns=function obj_pt_setCountDropdowns(B,A){this.count_dropdowns=B;this.count_dropdowns_selected=A};ObjectProductTotals.prototype.isProductReadyToOrder=function obj_pt_isProductReadyToOrder(){var A=(this.total!=0);if(this.count_checkboxes>0){A=A||(this.count_checkboxes_selected>0)}if(this.count_radiobuttons>0){A=A||(this.count_radiobuttons_selected>0)}if(this.count_dropdowns>0){A=A||(this.count_dropdowns_selected>0)}A=A||((this.count_checkboxes==0)&&(this.count_radiobuttons==0)&&(this.count_dropdowns==0));return A};ObjectProductTotals.prototype.isProductReadyToOrderRequired=function obj_pt_isProductReadyToOrderRequired(){return this.count_required<=this.count_required_selected};function startsWith(C,B){var A=new RegExp("^"+B);return A.test(C)}function endsWith(C,B){var A=new RegExp(B+"$");return A.test(C)}function prepareFileName(A){return trim(A.replace(/\s+/g,"_").replace(/[^0-9a-zA-Z_\.\-]+/g,""))}function strip_tags(A){return A.replace(/<\/?[^>]+>/gi,"")}function setClassNameByElementId(A,B){if(document.getElementsByName){var C=document.getElementById(A);if(C){C.className=B}}}function setClassNameByElementName(D,C){var A=document.getElementsByName(D);if(A&&A.length>0){for(var B=0;B<A.length;B++){A[B].className=C}}else{setClassNameByElementId(D,C)}}function openNewWindow(B,A){openNewWindowWithAttr(B,A,"left=100,top=100,width=500,height=100,scrollbars=no,resizable=yes,toolbar=no")}function openNewWindowWithAttr(C,B,A){newWindow=window.open(C,B,A);if(window.focus){newWindow.focus()}}function getUrlArguments(B){var A=new Array();B+="";if(B){urlParts=B.split("?");if(urlParts[1]){arguments=urlParts[1].split("&");if(arguments[0]){for(i in arguments){pair=arguments[i].split("=");if(pair[1]){A[pair[0]]=pair[1]}}}}}return A}function getUrlBaseName(A){baseName="";A+="";if(A){urlParts=A.split("?");baseName=urlParts[0]}return baseName}function linkAddReferrerAndForwardToOriginalLink(A){cookieReferrer=getCookie("cookie_scart_referrer");if(cookieReferrer!=null&&cookieReferrer!=""&&A.href){urlArgs=getUrlArguments(A.href);urlArgs["referrer"]=cookieReferrer;urlArgsStr="";for(argKey in urlArgs){urlArgsStr+=(urlArgsStr!=""?"&":"")+argKey+"="+escape(urlArgs[argKey])}if(urlArgsStr!=""){urlArgsStr=getUrlBaseName(window.location)+"?"+urlArgsStr;window.location=urlArgsStr}return false}return true}var waitPanel=null;function showLoadingWindow(B){if(waitPanel==null){var A=typeof (loadingImgSrc)!="undefined"&&loadingImgSrc!=null?loadingImgSrc:"http://www.searchfit.com/scart/public/images/anim_indicator_big.gif";waitPanel=new YAHOO.widget.Panel("waitPanel",{width:175,fixedcenter:true,close:false,draggable:false,zindex:9999,modal:true,visible:false});waitPanel.setHeader(B);waitPanel.setBody('<table border="0" align="center" cellspacing="0" cellpadding="20"><tr><td align="center"><img src="'+A+'" border="0" /></td></tr></table>');waitPanel.render(document.body)}waitPanel.show();return waitPanel}function hideLoadingWindow(){if(waitPanel!=null){waitPanel.hide()}}function resizeWindowByElement(C){if(C){var A=document.getElementById(C);if(A){var B=YAHOO.util.Region.getRegion(A);var D=(window.innerWidth)?window.innerHeight:document.body.clientHeight;D=B.bottom-D;window.resizeBy(0,D)}}}function isEmailCorrect(A){return A.match(/\b(^(\S+@).+((\.com)|(\.net)|(\.edu)|(\.mil)|(\.gov)|(\.org)|(\.int)|(\.biz)|(\.info)|(\.name)|(\..{2,2}))$)\b/gi)}function isIPCorrect(A){return A.match(/[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/gi)}function validateRequiredFormFields(A){for(var B=0;B<A.length;B++){var D=trim(get_field_value_bytype(A[B],""));if(D==""){var C=A[B].getAttribute("isRequired");if(C!=null&&C=="1"){alert(getLabelForField(A[B])+" is a Required Field");try{A[B].focus()}catch(F){}return false}}else{if(A[B].getAttribute("requiredType")!=null){var G=A[B].getAttribute("requiredType");if(G!=null){var E=null;if(G=="email"){if(!isEmailCorrect(D)){E=getLabelForField(A[B])+" field has Invalid Email"}}else{if(G=="ip"){if(!isIPCorrect(D)){E=getLabelForField(A[B])+" field has Invalid IP"}}}if(E!=null){alert(E);try{A[B].focus()}catch(F){}return false}}}}}return true}function getLabelForField(D){var C=D.getAttribute("label");if(C==null){var A=D.parentNode;var B=A.getElementsByTagName("label")[0];if(B==null){A=A.parentNode;B=A.getElementsByTagName("label")[0]}C=B!=null?B.innerHTML:"Unknown"}return C}if(typeof SFUI=="undefined"||!SFUI){var SFUI={}}SFUI.Ajax={waitPanel:null,dynamicPanelInstance:null,showDynamicPanel:function(F,B,C){var D=C.isPanelModal!=null?C.isPanelModal:true;this.showLoadingWindow("Loading, Please Wait...",D);var A="action="+C.action+"&wsParams[multipart_result]=isDynamicPage="+F;A+=",clientWidth="+YAHOO.util.Dom.getViewportWidth()+",clientHeight="+YAHOO.util.Dom.getViewportHeight();A+=",uid="+C.uid;if(C.params!=null&&C.params!=""){A+=","+C.params.replace(/&/g,",")}var E={success:function(I){var H=getMultipartResultById(I.responseText,"multipart_result");if(H==""){H=geWsErrorDescription(I.responseText,true)}SFUI.Ajax.hideLoadingWindow();if(SFUI.Ajax.dynamicPanelInstance==null){SFUI.Ajax.dynamicPanelInstance=new YAHOO.widget.Panel("dynamicPanelContainer",{zindex:1001,visible:false,fixedcenter:true,draggable:true,close:true,modal:D,constraintoviewport:true})}SFUI.Ajax.dynamicPanelInstance.setHeader(C.header);SFUI.Ajax.dynamicPanelInstance.setBody(H);SFUI.Ajax.dynamicPanelInstance.render(document.body);SFUI.Ajax.dynamicPanelInstance.show();launchJavascript(I.responseText)},failure:function(H){SFUI.Ajax.hideLoadingWindow();alert("Failed showDynamicPanel ("+H.status+" "+H.statusText+")")}};var G=YAHOO.util.Connect.asyncRequest("POST",B,E,A);if(G==null){SFUI.Ajax.hideLoadingWindow()}},showLoadingWindow:function(C,B){if(this.dynamicPanelInstance!=null){this.dynamicPanelInstance.hide()}if(this.waitPanel==null){if(B==null){B=true}var A=typeof (loadingImgSrc)!="undefined"&&loadingImgSrc!=null?loadingImgSrc:"http://www.searchfit.com/scart/public/images/anim_indicator_big.gif";this.waitPanel=new YAHOO.widget.Panel("waitPanel",{width:175,fixedcenter:true,close:false,draggable:false,zindex:9999,modal:B,visible:false});this.waitPanel.setHeader(C);this.waitPanel.setBody('<table border="0" align="center" cellspacing="0" cellpadding="20"><tr><td align="center"><img src="'+A+'" border="0" /></td></tr></table>');this.waitPanel.render(document.body)}this.waitPanel.show()},hideLoadingWindow:function(){if(this.waitPanel!=null){this.waitPanel.hide()}}};if(typeof SFUI=="undefined"||!SFUI){var SFUI={}}SFUI.Scrollable={scrollTimer:null,scrollPixels:0,initNavigator:function(B){var F=document.getElementById(B);var D=YAHOO.util.Dom.getRegion(F);var A=document.getElementById(B+"_scrollUpNavigator");A.style.display=F.scrollTop>0?"inline":"none";if(A.style.display=="inline"){YAHOO.util.Dom.setX(A,D.left);YAHOO.util.Dom.setY(A,D.top);YAHOO.util.Dom.setStyle(A,"width",(D.right-D.left)+"px")}var E=document.getElementById(B+"_scrollDownNavigator");E.style.display=(F.scrollTop+D.bottom-D.top)<F.scrollHeight?"inline":"none";if(E.style.display=="inline"){var C=YAHOO.util.Dom.getRegion(E);YAHOO.util.Dom.setX(E,D.left);YAHOO.util.Dom.setY(E,D.bottom-(C.bottom-C.top));YAHOO.util.Dom.setStyle(E,"width",(D.right-D.left)+"px")}},scrollVertically:function(A,B){this.scrollPixels+=B>0?1:-1;if(Math.abs(this.scrollPixels)>25){B*=2;this.scrollPixels=0}document.getElementById(A).scrollTop+=B;this.initNavigator(A);this.scrollTimer=setTimeout("SFUI.Scrollable.scrollVertically('"+A+"', "+B+")",10)},stopScrollVertically:function(){if(this.scrollTimer!=null){clearTimeout(this.scrollTimer);this.scrollTimer=null;this.scrollPixels=0}}};function checkWin(A){if(!A){showPopupBlockerMsg();return false}return true}function showPopupBlockerMsg(){alert("Please turn off the ad/popup blocker to allow the requested function.")}function showNoPopupBlockerMsg(){alert("It seems you do not have a problematic Ad/Popup blocker turned on for your browser.\nYou should be able to work with the webpages without any problems.")}function useCalendar(B,A,C){targetDateAsTextField=A;targetDateAsTimeField=C;if(C!=null){B+="&date_as_time_selected="+escape(C.value)}if(A!=null){B+="&date_as_text_selected="+escape(A.value)}calendarWindow=window.open(B,"Calendar","left=50,screenX=50,top=50,screenY=50,width=250,height=250,scrollbars=0,resizable=1");if(window.focus){calendarWindow.focus()}}var compareProductsPanel=null;var compareProductsMenu=null;function compareProducts(G,B,D,E,F,C){var H=getCookie("cookie_scart_compareProductIds");var A=new Array();if(F.checked){if(H!=null){setCookie("cookie_scart_compareProductIds",H+","+E,1);showCompareProductsMenu(F,D,B,G,C)}else{setCookie("cookie_scart_compareProductIds",E,1)}}else{if(H!=null){A=H.split(",")}H="";for(i=0;i<A.length;i++){if(A[i]!=E){if(H!=""){H+=","}H+=A[i]}}setCookie("cookie_scart_compareProductIds",H,1)}}function showCompareProductsMenu(H,F,I,A,D){var G=getCookie("cookie_scart_compareProductIds");var J=G.split(",");var B=document.getElementById("compareProductsMenuContainer");if(!B){B=document.createElement("div");B.setAttribute("id","compareProductsMenuContainer");B.setAttribute("class","yui-skin-sam");B.setAttribute("className","yui-skin-sam");document.body.insertBefore(B,null)}if(compareProductsMenu!=null){compareProductsMenu.destroy()}var E=new Array(H,"tl","bl");compareProductsMenu=new YAHOO.widget.Menu("compareProductsMenu",{zindex:99999,context:E,iframe:false,constraintoviewport:true});compareProductsMenu.addItems([{text:D[0],url:"#compareNow",onclick:{fn:onCompareProductsMenuItemClick,obj:[F,I,A]}},{text:D[1],url:"#resetCompare",onclick:{fn:onCompareProductsMenuItemClick,obj:[F,I,A]}},{text:D[2],url:"#compareLater",onclick:{fn:onCompareProductsMenuItemClick,obj:[F,I,A]}}]);if(D[3]!=""){var C=D[3].split("%s");compareProductsMenu.setItemGroupTitle(C[0]+J.length+C[1],0)}compareProductsMenu.render(B.id);compareProductsMenu.show()}function onCompareProductsMenuItemClick(D,C,H){var G=getCookie("cookie_scart_compareProductIds");var B=G.split(",");if(this.index==0){var E=H[0];var A=H[1];var F=H[2];showCompareProductsWindow(E,A,F)}else{if(this.index==1){for(i=0;i<B.length-1;i++){current_checkbox=document.getElementById("compareProduct_"+B[i]);if(current_checkbox!=null){current_checkbox.checked=false}}setCookie("cookie_scart_compareProductIds",B[(B.length-1)],1)}}}function showCompareProductsWindow(E,C,F){var H=getCookie("cookie_scart_compareProductIds");var B=H.split(",");showLoadingWindow("Loading, Please Wait...");var A="action=getCompareProductsContent&wsParams[multipart_result]=uid="+E+",isDynamicPage="+(F?"1":"0");A+=",clientWidth="+YAHOO.util.Dom.getViewportWidth()+",clientHeight="+YAHOO.util.Dom.getViewportHeight();for(i=0;i<B.length;i++){A+=",productCompareId"+i+"="+B[i]}var D={success:function(J){var I=getMultipartResultById(J.responseText,"multipart_result");if(I==""){I=geWsErrorDescription(J.responseText,true)}hideLoadingWindow();if(compareProductsPanel!=null){compareProductsPanel.hide()}else{compareProductsPanel=new YAHOO.widget.Panel("compareProductsPanel",{zindex:1001,visible:false,fixedcenter:true,draggable:true,close:true,modal:true,constraintoviewport:true})}compareProductsPanel.setHeader("Compare Products");compareProductsPanel.setBody(I);compareProductsPanel.render(document.body);compareProductsPanel.show();launchJavascript(J.responseText)},failure:function(I){hideLoadingWindow();alert("Failed compareProducts ("+I.status+" "+I.statusText+")")}};var G=YAHOO.util.Connect.asyncRequest("POST",C,D,A);if(G==null){hideLoadingWindow()}}function isProductSelectedForCompare(B,C){var D=getCookie("cookie_scart_compareProductIds");var A=new Array();if(D!=null){A=D.split(",")}for(i=0;i<A.length;i++){if(A[i]==B){C.checked=true;break}}}var productReviewsPanel=null;function showProductReviewsPanel(G,C,E,F,B){showLoadingWindow("Loading, Please Wait...");var A="action=getProductReviewsContent&wsParams[multipart_result]=isDynamicPage="+G;A+=",clientWidth="+YAHOO.util.Dom.getViewportWidth()+",clientHeight="+YAHOO.util.Dom.getViewportHeight();A+=",uid="+E+",pid="+F;if(B!=null&&B!=""){A+=","+B.replace("&",",")}var D={success:function(J){var I=getMultipartResultById(J.responseText,"multipart_result");if(I==""){I=geWsErrorDescription(J.responseText,true)}hideLoadingWindow();if(productReviewsPanel==null){productReviewsPanel=new YAHOO.widget.Panel("productReviewsPanel",{zindex:1001,visible:false,fixedcenter:true,draggable:true,close:true,modal:true,constraintoviewport:true})}productReviewsPanel.setHeader("Product Reviews");productReviewsPanel.setBody(I);productReviewsPanel.render(document.body);productReviewsPanel.show();launchJavascript(J.responseText)},failure:function(I){hideLoadingWindow();alert("Failed showProductReviewsPanel ("+I.status+" "+I.statusText+")")}};var H=YAHOO.util.Connect.asyncRequest("POST",C,D,A);if(H==null){hideLoadingWindow()}}var productReviewHelpful=null;function reportProductReviewHelpful(B,I,E,H,F,A){showLoadingWindow("Loading, Please Wait...");var G="action=addProductReviewHelpful&wsParams[multipart_result]=isDynamicPage="+B;if(F){G+=",helpful=yes"}else{G+=",helpful=no"}G+=",clientWidth="+YAHOO.util.Dom.getViewportWidth()+",clientHeight="+YAHOO.util.Dom.getViewportHeight();G+=",uid="+E+",prodReviewId="+H;if(A!=null&&A!=""){G+=","+A.replace("&",",")}var D={success:function(K){var J=getMultipartResultById(K.responseText,"multipart_result");if(J==""){J=geWsErrorDescription(K.responseText,true)}launchJavascript(K.responseText);hideLoadingWindow();alert(J)},failure:function(J){hideLoadingWindow();alert("Failed reportProductReviewHelpful ("+J.status+" "+J.statusText+")")}};var C=YAHOO.util.Connect.asyncRequest("POST",I,D,G);if(C==null){hideLoadingWindow()}}var productReviewAbuse=null;function reportProductReviewAbuse(G,D,E,F,C){showLoadingWindow("Loading, Please Wait...");var B="action=addProductReviewAbuse&wsParams[multipart_result]=isDynamicPage="+G;B+=",clientWidth="+YAHOO.util.Dom.getViewportWidth()+",clientHeight="+YAHOO.util.Dom.getViewportHeight();B+=",uid="+E+",prodReviewId="+F;if(C!=null&&C!=""){B+=","+C.replace("&",",")}var A={success:function(J){var I=getMultipartResultById(J.responseText,"multipart_result");if(I==""){I=geWsErrorDescription(J.responseText,true)}launchJavascript(J.responseText);hideLoadingWindow();alert(I)},failure:function(I){hideLoadingWindow();alert("Failed reportProductReviewAbuse ("+I.status+" "+I.statusText+")")}};var H=YAHOO.util.Connect.asyncRequest("POST",D,A,B);if(H==null){hideLoadingWindow()}}var viewReviewCommentsPanel=null;function showViewProductReviewComments(C,I,F,E,A,B){showLoadingWindow("Loading, Please Wait...");var H="action=getProductReviewCommentsContent&wsParams[multipart_result]=isDynamicPage="+C;H+=",clientWidth="+YAHOO.util.Dom.getViewportWidth()+",clientHeight="+YAHOO.util.Dom.getViewportHeight();H+=",uid="+F+",pid="+E+",rid="+A;if(B!=null&&B!=""){H+=","+B.replace("&",",")}var G={success:function(K){var J=getMultipartResultById(K.responseText,"multipart_result");if(J==""){J=geWsErrorDescription(K.responseText,true)}hideLoadingWindow();if(viewReviewCommentsPanel==null){viewReviewCommentsPanel=new YAHOO.widget.Panel("viewReviewCommentsPanel",{zindex:1001,visible:false,fixedcenter:true,draggable:true,close:true,modal:true,constraintoviewport:true})}viewReviewCommentsPanel.setHeader("Product Review Comments");viewReviewCommentsPanel.setBody(J);viewReviewCommentsPanel.render(document.body);viewReviewCommentsPanel.show();launchJavascript(K.responseText)},failure:function(J){hideLoadingWindow();alert("Failed showViewProductReviewComments ("+J.status+" "+J.statusText+")")}};var D=YAHOO.util.Connect.asyncRequest("POST",I,G,H);if(D==null){hideLoadingWindow()}}var productReviewCommentHelpful=null;function reportProductReviewCommentHelpful(B,I,D,E,F,A){showLoadingWindow("Loading, Please Wait...");var H="action=addProductReviewCommentHelpful&wsParams[multipart_result]=isDynamicPage="+B;if(F){H+=",helpful=yes"}else{H+=",helpful=no"}H+=",clientWidth="+YAHOO.util.Dom.getViewportWidth()+",clientHeight="+YAHOO.util.Dom.getViewportHeight();H+=",uid="+D+",prodReviewCommentId="+E;if(A!=null&&A!=""){H+=","+A.replace("&",",")}var G={success:function(K){var J=getMultipartResultById(K.responseText,"multipart_result");if(J==""){J=geWsErrorDescription(K.responseText,true)}launchJavascript(K.responseText);hideLoadingWindow();alert(J)},failure:function(J){hideLoadingWindow();alert("Failed reportProductReviewCommentHelpful ("+J.status+" "+J.statusText+")")}};var C=YAHOO.util.Connect.asyncRequest("POST",I,G,H);if(C==null){hideLoadingWindow()}}var productReviewCommentAbuse=null;function reportProductReviewCommentAbuse(G,C,F,D,B){showLoadingWindow("Loading, Please Wait...");var A="action=addProductReviewCommentAbuse&wsParams[multipart_result]=isDynamicPage="+G;A+=",clientWidth="+YAHOO.util.Dom.getViewportWidth()+",clientHeight="+YAHOO.util.Dom.getViewportHeight();A+=",uid="+F+",prodReviewCommentId="+D;if(B!=null&&B!=""){A+=","+B.replace("&",",")}var E={success:function(J){var I=getMultipartResultById(J.responseText,"multipart_result");if(I==""){I=geWsErrorDescription(J.responseText,true)}launchJavascript(J.responseText);hideLoadingWindow();alert(I)},failure:function(I){hideLoadingWindow();alert("Failed reportProductReviewCommentAbuse ("+I.status+" "+I.statusText+")")}};var H=YAHOO.util.Connect.asyncRequest("POST",C,E,A);if(H==null){hideLoadingWindow()}}/**********************************************************
 * Ajax Connection and callback functions
 **********************************************************/
function AjaxConnection() {
    this.http_request           = null;
    this.processer              = function (root_node, ajax) {};
    this.base_tag               = "bts";
    this.not_ready_callback     = function(response_code, aj) { };
    this.errorHandler           = function (text, aj) { };
    this.errorTag               = "Error";
    this.request_type           = 'get';
    this.post_vars              = new Array();
};

/**********************************************************
AjaxConnection::addPostVar

Add a variable to post (if we are posting)
***********************************************************/

AjaxConnection.prototype.addPostVar = function(name, value) {
    this.post_vars[this.post_vars.length] = encodeURIComponent(name) + '=' + encodeURIComponent(value);
    this.request_type                     = 'post';
}

AjaxConnection.prototype.clearPost = function() {
    this.post_vars                        = new Array();
    this.request_type                     = 'get';
}

/**********************************************************
AjaxConnection::CreateAjax

Create the XMLHttpRequest class, with the evil evil switch
to see if IE supports it.
***********************************************************/
AjaxConnection.prototype.CreateAjax = function() {
    /*@cc_on @*/
    
    /*@if (@_jscript_version >= 5)
    try {
        this.http_request = new ActiveXObject("Msxml2.XMLHTTP");
    } catch (e) {
        try {
            this.http_request = new ActiveXObject("Microsoft.XMLHTTP");
        } catch (E) {
            this.http_request = null;
        }
    }
    @end @*/
    
    if (!this.http_request && typeof XMLHttpRequest != 'undefined') {
        this.http_request = new XMLHttpRequest();
    }

    if (!this.http_request) {
        this.errorHandler('Fatal Error: couldn\'t create AJAX request, old browser?, IE with ActiveX disabled?', this);
        return;
    }
    return this.http_request;
}

/**********************************************************
AjaxConnection::Connect

Connect to the inputted URL
***********************************************************/
AjaxConnection.prototype.Connect = function(url) {
    this.CreateAjax();
    if (this.http_request) {
        var listener = this;
        this.http_request.onreadystatechange = function() { listener.readyChange(); };
        
        this.http_request.open(this.request_type.toUpperCase(), url, true);
        
        if (this.request_type.toLowerCase() == 'post') {
            this.http_request.setRequestHeader('Content-Type', "application/x-www-form-urlencoded; charset=UTF-8");
            this.http_request.send(this.post_vars.join('&'));
        } else {
            this.http_request.send(null);
        }    
    }
}


/**********************************************************
AjaxConnection::handleEvent

Handles the onreadystatechange event
***********************************************************/
AjaxConnection.prototype.readyChange = function() {
    if (!this.http_request) {
		this.errorHandler("request is still false", this);
        return;
    }

    if (this.http_request.readyState == 4) {
        if (this.http_request.status == 200 || (this.http_request.status >= 500 && this.http_request.status <= 599) ) {
		
            var xmldoc = this.http_request.responseXML;            
            var root_node;
            
            if (!xmldoc || !xmldoc.firstChild) {
        		if (this.http_request.status != 200) {
		            this.errorHandler("Error connecting to Ajax, Reason: HTTP/" + this.http_request.status, this);
        		} else {
	                this.errorHandler("Failed parsing XML Document", this);
                }
                return;
            }
            
            // this works in mozilla, need to find the IE version
            root_node = xmldoc.firstChild;
            if (root_node.nodeName == "parsererror") {
                this.errorHandler(root_node.nodeName + "\n\n" + this.http_request.responseText, this);
                return;
            }
            
            // okay lets find out who we are supposed to contact
            
            root_node = xmldoc.documentElement;
            this.root_node = root_node;
            
            if (!this.checkBtsAjaxError(root_node)) {
                return;
            }
            
            this.processer(root_node, this); 
            
        } else {
            this.errorHandler("Error connecting to Ajax, Reason: HTTP/" + this.http_request.status, this);
        }
    } else {
        this.not_ready_callback(this.http_request.readyState, this);
    }    
}

/**********************************************************
AjaxConnection::checkBtsAjaxError

Checks and sees if there has been an error in the processing
of the command
***********************************************************/
AjaxConnection.prototype.checkBtsAjaxError = function(root_node) {
    if (!root_node) {
        this.errorHandler("Root Node Is Not Defined", this);
        return false;
    }
    
    var error = root_node.getElementsByTagName(this.errorTag).item(0);
    
    if (error && error.nodeName == this.errorTag) {
        if (error.firstChild) {
            this.errorHandler(error.firstChild.nodeValue, this);
        } else {
            this.errorHandler('error was sent by the ajax processor, but had no content', this);
        }
        return false;
    }
    
    var nologin = root_node.getElementsByTagName("nologin").item(0);
    
    if (nologin) {
        window.location.href = 'index.xml';
        return false;
    }
    return true;
}

function AjaxPlainHTML(box_id, url) {
    this.box_id                 = box_id;
    var ajax                    = new AjaxConnection();
    this.a                      = ajax.CreateAjax();
    var listener                = this;
    this.a.onreadystatechange   = function() { listener.AjaxPlainHTMLDone() };
    this.url                    = url;    
    
    // standard display function, may be changed
    this.display                = function(text) {
        var frame = document.getElementById(listener.box_id);
        if (frame) {
            frame.innerHTML = text;
        }
    }    
}

AjaxPlainHTML.prototype.Send = function() { 
    this.a.open('GET', this.url, true);
    this.a.send(null);        
}

AjaxPlainHTML.prototype.AjaxPlainHTMLDone = function() {
    if (this.a.readyState == 4) {
        this.display(this.a.responseText);
    }
}

function murderChildren(element) {
    while (element.childNodes[0]) {
        element.removeChild(element.childNodes[0]);
    }
}

function BlindAjax(url) {
    this.ajax               = new AjaxConnection;
    this.ajax.base_tag      = 'DomainAdmin';
    this.url                = url;
    var t                   = this;
    this.done               = function() { };
    this.ajax.processer     = function(root_n, aj) { t.done(); } ;
}

BlindAjax.prototype.Connect = function() {
    this.ajax.Connect(this.url);
}


/**********************************************************
 * Ajax Connection and callback functions
 **********************************************************/
function AjaxConnectionText() {
    this.http_request           = null;
    this.processer              = function (root_node, ajax) {};
    this.base_tag               = "bts";
    this.not_ready_callback     = function(response_code, aj) { };
    this.errorHandler           = function (text, aj) { this.errorHandler(text); };
    this.errorTag               = "Error";
    this.request_type           = 'get';
    this.post_vars              = new Array();
};

AjaxConnectionText.prototype = new AjaxConnection;

/**********************************************************
AjaxConnectionText::handleEvent

Handles the onreadystatechange event
***********************************************************/
AjaxConnectionText.prototype.readyChange =  function() {
    if (!this.http_request) {
        this.errorHandler("request is still false", this);
        return;
    }

    if (this.http_request.readyState == 4) {
        if (this.http_request.status == 200 || (this.http_request.status >= 500 && this.http_request.status <= 599) ) {
            this.processer(this.http_request.responseText, this); 
        } else {
            this.errorHandler("Error connecting to Ajax, Reason: HTTP/" + this.http_request.status, this);
        }
    } else {
        this.not_ready_callback(this.http_request.readyState, this);
    }    
};
/**
 * DOM Utilities
 * @author Ben Wilder <bwilder@rwugsa.com>
 * 
 * $Id: dom-util.js,v 1.2 2009/08/31 17:53:06 bwilder Exp $
 */

var isOpera = false;
var isIE = false;
if(typeof(window.opera) != 'undefined'){
	isOpera = true;
}

if(!isOpera && navigator.userAgent.indexOf('MSIE') >= 0){
	isIE = true;
} 
  
var _namespace = 'http://www.w3.org/1999/xhtml';
var _nspfx     = 'html:';
function createDOMElement(element_name) {
    if (document.createElementNS) {
        return document.createElementNS(_namespace, _nspfx + element_name);       
    } 
    return document.createElement(element_name);    
}

 
/** 
 * Change the CSS of a dom element to the new class
 * @param DomElement a
 * @param string class_name
 */
function setCss(a, class_name) {
    a.setAttribute('class', class_name);
    a.setAttribute('className', class_name);
}

/**
 * create an Image tag using the selected src and alt tag
 * @param string src
 * @param string alt
 * @return DomElement
 */
function createImageDom(src, alt) {
    var img = createDOMElement( 'img');
    img.setAttribute('src', src);
    img.setAttribute('alt', alt);
    return img;
}

/**
 * gets the value of the selected option in a select box
 *
 * @param DomElement element 
 *  - the <select> box
 * @return string/false
 */
function getSelectedOptionValue(element) {
    if (!element.options[element.selectedIndex]) {
        return false;
    }
    return element.options[element.selectedIndex].value;
}

/**
 * Table Outline, onmouseover event callback which will
 * change the border and the outline of a table because
 * the user will click on it and go somewhere else 
 * (this actually works for all elements not just a table)
 *
 * @param DomElement element
 */
function tolOv(element) {
    element.style.border = "1px solid red";
    element.style.outline = "1px solid red";
    element.style.cursor  = "pointer";
}

/**
 * Table outline onmouseout event callback
 *
 * @param DomElement element
 */
function tolOu(element) {
    element.style.border = "1px solid black";
    element.style.outline = "0px";
}



/**
 * return the value of the inputted element, element should be an
 * input type element (input | textarea | select) to return the
 * actual value of the element
 *
 * @param DomElement element
 * @return string|false
 */
function getValueFromElement(element) {

    if (!element) {
        return false;
    }

    if (!element.nodeName) {
        return false;
    }    

    if (element.disabled) { 
        return false; 
    } 
    
    var node_name = element.nodeName.toLowerCase();
    
    if (element.localName) {
        node_name = element.localName.toLowerCase();
    }

    if (node_name == 'input' || node_name == 'textarea') {
        var box_type = element.attributes.getNamedItem('type');
        
        if (box_type && (box_type.value.toLowerCase() == 'checkbox' || box_type.value.toLowerCase() == 'radio')) {
            if (element.checked) {
                return element.value;
            } else {
                return false;
            }
        } else {
            return element.value;
        }               
    } else if (node_name == 'select') {
        if (element.selectedIndex >= 0) {
            return getSelectedOptionValue(element);
        }
    } 
    
    return false;

}

// Removes leading whitespaces
function LTrim( value ) {
    
    var re = /\s*((\S+\s*)*)/;
    return value.replace(re, "$1");
    
}

// Removes ending whitespaces
function RTrim( value ) {
    
    var re = /((\s*\S+)*)\s*/;
    return value.replace(re, "$1");
    
}

// Removes leading and ending whitespaces
function trim( value ) {
    
    return LTrim(RTrim(value));
    
}

/**
 * simple ajax connection execution
 * @param string url
 * @param DOM parent_node = null
 */
function loadAJ(url, parent_node) {
    var ajax = new AjaxConnection;
    
    ajax.processer = function(root_node, aj) {
        xmlToDom(parent_node, root_node);
    }
    ajax.base_tag = 'DomainAdmin';
    ajax.Connect(url);        
}

function onloadAJ(url, parent_node) {
	this.onload = function() {
		loadAJ(url, parent_node);
	}
}

function replaceInner(parent_id, url) {
	this.onload = function() { 
		var parent;
		
		if (!(parent = document.getElementById(parent_id))) {
			return; 
		}
		
		var aj = new AjaxConnectionText;
		aj.processer = function(txt, aj) { 
			var spl = txt.split(/\[\/?exec\]/);
			var html = '';
			for (var x = 0; x < spl.length; x++) {
				if (x % 2 == 1) {
					eval(spl[x]);
				} else {
					html += spl[x];
				}
			}
			parent.innerHTML = html; 
		};
		aj.Connect(url);
	}
}

/**
 * simple AJAX loading with post
 * @param string url
 * @param DOM parent_node = null
 */
function LoadAjaxSimple(url, parent_node) {	
    this.ajax = new AjaxConnection;
    
    this.ajax.processer = function(root_node, aj) {
        xmlToDom(parent_node, root_node);
    }
    this.url = url;
    this.post_elements = new Array();
}

LoadAjaxSimple.prototype = {
	onclick: function() {
	    for (key in this.post_elements) {
	        var element = this.post_elements[key];
	        
	        var value   = getValueFromElement(element);
	        if (value !== null) {
	            this.ajax.addPostVar(element.name, value);
	        }        
	    }
	    this.post_elements = new Array();
		this.ajax.Connect(this.url);
	},
	addPostElement: function(element) {
	    if (element) {
	        this.post_elements.push(element);
	    }
	}
}

/**
 * xmlToDom
 * convert an XML document tree to an HTML document by appending it
 * to the inputted dom node
 *
 * parent_node  :   the DOM node to add the XML information to
 * xml_node     :   the XML node to take the information from
 * insert_after :   if specified, it will be added after this
 *                  child node of parent_node, instead of the end
 */
function xmlToDom(parent_node, xml_node, insert_after) {
    var dom = null;
    var inserted = false;     
    var exec_text = null;  
    
    if (xml_node.nodeType == 3 || xml_node.nodeType == 4) {
		if (parent_node) {
			parent_node.appendChild(document.createTextNode(xml_node.nodeValue));
		}
		return;
    }
        
    if (xml_node.nodeName == 'Logout') {
        alert('You are not logged in');
        window.location.reload();
        return;
    }    
    
    // parse the PHP error node to add the error to the error list
    if (xml_node.nodeName == 'PHPError') {
        if (aj_error_handler) {
            aj_error_handler.addPostVar("msg[]", xml_node.firstChild.nodeValue);
            show_error_box(error_box_dom_id);
        }
        return;
    }
    
    // replace the inputted DOM id with the 
    // contents of this node
    if (xml_node.nodeName == 'ReplaceDOM') {
        replaceDOM(xml_node);
        return;
    }
    
    if (xml_node.nodeName == 'RemoveDOM') {
		var	id = xml_node.attributes.getNamedItem('id');
		if (id && id.value) {
			removeDomId(id.value);
		}
			
		return;
    }
    
    if (xml_node.nodeName == 'AppendDOM') {
		var	id = xml_node.attributes.getNamedItem('id');
		if (id && id.value) {		
			var element = document.getElementById(id.value);
			if (element) {
			    for (var x = 0; x < xml_node.childNodes.length; x++) {
			        xmlToDom(element, xml_node.childNodes[x]);
            	}		            
			}
		}
    	return;
    }
    
    if (xml_node.nodeName == 'ClosePopup') {
        closePopup();
        return;
    }
    
    if (xml_node.nodeName == 'RefreshBoxLoader') {
        if (active_box_loader && active_box_loader.loadBox) {
            active_box_loader.loadBox(null);
        }
        return;
    }
    
    if (xml_node.nodeName == 'ReloadPage') {
        window.location.reload();
        return;
    }
    
    if (xml_node.nodeName == 'RedirectTo') {
        window.location.href = xml_node.firstChild.nodeValue;
        return;
    }
    
    
    // script node? evaluate it's contents
    // NOTE: vars are considered local to the eval, so if you need the value
    // somewhere that is not in this script block, you are SOL.
    if (xml_node.nodeName == 'script') {
        // assume script has only 1 cdata field
        if (xml_node.firstChild) {
            eval(xml_node.firstChild.nodeValue);
        }
        return;
    }
    
    var chk = false;
    
    if (xml_node.nodeName != 'RequireRow' && xml_node.nodeName != 'DomainAdmin' && xml_node.nodeName != 'template') {
		var suppress_name = false;
        if (isIE && xml_node.nodeName == 'input' && xml_node.attributes && xml_node.attributes.getNamedItem("name") ) {
			// guess what, IE == SHIT, why you ask? because it doesn't set the fucking name="" attribute
			// dynamicly.. why the fuck would it do that... well, because the people who work for microsoft are idiots.
			var n = xml_node.attributes.getNamedItem("name");
			var t = xml_node.attributes.getNamedItem("type");
			if (t && t.value == "radio") {
				dom = document.createElement('<' + xml_node.nodeName + ' name="'+n.value+'" type="'+t.value+'>'); // ugly ugly ugly
				suppress_name = true;
			} else if (t && t.value == "checkbox" && n && n.value && xml_node.attributes.getNamedItem("checked")) {
				dom = document.createElement('<' + xml_node.nodeName + ' name="'+n.value+'" checked type="'+t.value+'>'); // ugly ugly ugly
				suppress_name = true;				
			} else {
				dom = document.createElement('<' + xml_node.nodeName + ' name="'+n.value+'" type="'+(t && t.value ? t.value : '')+'>');
				suppress_name = true;
			}
        } else {
	        dom = createDOMElement(xml_node.nodeName);
        }
        
        dom.event_eval = new Array();
        var attr_ct = xml_node.attributes.length;
        for (var x = 0; x < attr_ct; x++) {
                        
            var name  = xml_node.attributes[x].name.toLowerCase(); 
            var value = xml_node.attributes[x].value;
            
            // This switch is for attributes that Internet Explorer's 
            // stupid ass not compliant JScript garbage doesn't do correctly
            try {
	            switch (name) {
	                case 'class':
	                    setCss(dom, value);
	                break;
	                
	                // Fix IE not liking setAttribute to do events
	                case 'onclick':
	                case 'onchange':
	                case 'onmousedown':
	                case 'onmouseup':
	                case 'onmouseover':
	                case 'onmouseout':
	                case 'onmousemove':
	                case 'onreset':
	                case 'onselect':
	                case 'onsubmit':
	                case 'onunload':
	                case 'onload':
	                case 'onkeydown':
	                case 'onkeyup':
	                case 'onkeypress':
	                case 'onfocus':
	                case 'onerror':
	                case 'ondblclick':
	                case 'onblur':
	                case 'onabort':
	                    eval("dom." + name + "=function(){" + value + "};");
	                break;
	                
	                case 'name':
	                	if (!suppress_name) {
							dom.setAttribute(xml_node.attributes[x].name, value);
	                	}
	               	break;
	                
	                case 'run':
	                    exec_text = value.replace(/this/g, 'dom');
	                break;
	                
	                case 'checked':
	                    dom.checked = true;
	                    chk = true;
	                    dom.setAttribute(xml_node.attributes[x].name, value);
	                break;
	                
	                case 'colspan':
	                    dom.setAttribute(xml_node.attributes[x].name, value);
	                    dom.colSpan = parseInt(value);
	                break;
	                
	                case 'style':
	                    dom.setAttribute(xml_node.attributes[x].name, value);
	                    dom.style.cssText = value;
	                break;
	                
	                case 'type':
	                	if (!isIE || xml_node.nodeName != 'input') {
		                    dom.setAttribute(xml_node.attributes[x].name, value);	                		
	                	}
	                break;
	
	                default:                    
	                    dom.setAttribute(xml_node.attributes[x].name, value);
	                break;                    
	            }
            } catch (e) {
            	// Ignore the error
            }
        }
        
        if (parent_node) {
            if (insert_after) {
                var next_node = insert_after.nextSibling;
                if (next_node) { // verify that the next sibling is for reals
                    parent_node.insertBefore(dom, next_node);
                    inserted    = true;
                } else {
                    parent_node.appendChild(dom);
                }
            } else {
                parent_node.appendChild(dom);
            } 
        }    
                
        
    } else {
        dom = parent_node;
    }
    
    for (var x = 0; x < xml_node.childNodes.length; x++) {
        var c = xml_node.childNodes[x];
        
        if (c.nodeType == 3 || c.nodeType == 4) {
            if (dom) {
                dom.appendChild(document.createTextNode(c.nodeValue));
            }
        } else {
            if (inserted == false) {
                xmlToDom(dom, c, insert_after);
            } else {
                xmlToDom(dom, c, null);     // override insert_after because it has already been used
            }
        }
    }
    
    if (exec_text) {
    	eval(exec_text);
   	}
    
    if (chk == true) {
    	dom.checked = true;
   	}

    return dom;
}

function getAllTextNodes(node) {
	var str = '';
	var c   = null;
	for (var x = 0; x < node.childNodes.length; x++) {
		c = node.childNodes[x];
		if (c.nodeType == 3 || c.nodeType == 4) {
			str += c.nodeValue;
		} else {
			str += getAllTextNodes(c);
		}
	}
	
	return str;
}

/**
 * walk up a dom tree to find a specific node with the name
 *
 * element  : element to walk
 * nodeName : element to find
 */
function findParent(element, nodeName) {
    var cur = element;
    while (cur) {
        if (cur.nodeName.toLowerCase() == nodeName.toLowerCase()) {
            return cur;
        }
        cur = cur.parentNode;
    }
    return null;
}

 

/** 
 * this will process a ReplaceDOM node
 *
 * @param XML dom_node
 *  the <ReplaceDOM id="id">...</ReplaceDOM> tag
 */
function replaceDOM(dom_node) {
    // Replace the inputted dom id with the inputted xHTML
    var id_attr             = dom_node.attributes.getNamedItem('id');
    
    if (id_attr && id_attr.value) {                
        var cl = dom_node.attributes.getNamedItem('child');
        
        var repl_element    = document.getElementById(id_attr.value);
        if (!repl_element) {
            return false;
        }
        
        if (cl && cl.value) {
            
            murderChildren(repl_element);
            for (var x = 0; x < dom_node.childNodes.length; x++) {
                xmlToDom(repl_element, dom_node.childNodes[x], null);
            } 
            
        } else {
            var parent      = repl_element.parentNode;
            var item_node   = null;
            
            // pull the first real node out of the replaceDOM tree
            for (var x = 0; x < dom_node.childNodes.length; x++) {
                var child = dom_node.childNodes[x];
                
                if (child.nodeType == 3 || child.nodeType == 4) {
                    continue;
                } else {                  
                    item_node = child;
                    break;
                }
            }
            
            if (item_node == null) {
                return;
            }             
            
            if (item_node.nodeType >= 3 && item_node.nodeType <= 4) {
                dom = item_node;
            } else {
                dom = xmlToDom(null, item_node, null);
            }
                        
            // perform the replacement                        
            parent.replaceChild(dom, repl_element);
            repl_element = null;
            
            dom.setAttribute('id', id_attr.value);
        }
    }
}

var item_register = new Array();
function addItemRegister(item_name, item) {
    item_register[item_name] = item;
}
function getItemRegister(item_name) {
    return item_register[item_name];
}

function findPos(obj) {
    var curleft = curtop = 0;
    if (obj.offsetParent) {
        curleft = obj.offsetLeft
        curtop = obj.offsetTop
        while (obj = obj.offsetParent) {
            curleft += obj.offsetLeft
            curtop += obj.offsetTop
        }
    }
    
    var r =  new function() { };
    r.curtop = curtop;
    r.curleft = curleft;
    return r; 
}

function disableBoxDomId(dom_id) {
    var c = document.getElementById(dom_id);
    c.disabled = true;
    c.style.background = '#eaeaea';
}
function enableBoxDomId(dom_id) {
    var c = document.getElementById(dom_id);
    c.disabled = false;
    c.style.background = '';
}

function hideElement(id) {
    var e = document.getElementById(id);
    e.style.display = 'none';
}

function showElement(id) {
    var e = document.getElementById(id);
    e.style.display = '';
}

function removeDomId(dom_id) {
	var c = document.getElementById(dom_id);
	if (c && c.parentNode) {
		c.parentNode.removeChild(c);
		return true;
	}
	return false;
}
function kidnapChildren(target, source) {
	for (var x = 0; x < source.childNodes.length; x++) {
		var c = source.childNodes[x];
		target.appendChild(c);
		source.removeChild(c);
	}
}

function bind(toObject, methodName){
    return function(){toObject[methodName]()}
}


function _l(element, ext) {
	var u = element.href;
	u = u.replace(/\.[a-zA-Z]{1,6}(\?.+)?$/, ext+'$1');
	if (ext == '.xml') {
		show_popup_window(u);
		return false;
	} else if (ext == '.xhtml') { 
		active_box_loader.changeURL(u);
		active_box_loader.loadBox(null);
		return false;
	}
	return true;
}

function input_default(element) {
	if (element.has_clicked) { return; }
	element.value = '';
	element.has_clicked = true;
	element.style.color = '';
}

function has_input_default_clicked(element) {
	return element.has_clicked;
}

function clear_default_inputs(form) {
	for (var x = 0; x < form.elements.length; x++) {			
		var e=form.elements[x];
		e.onfocus();
	}	
}

function dropDownRedirect(select) {
	var value = getSelectedOptionValue(element);
	
	if (!value || value.length < 1) { return false; } 
	
	if (value.match(/http\:/)) {
		document.location.href = value;
		return true;
	}
	
	value = value.replace(/^\/+/, '');
	document.location.href = '/'+value;
	return true;
}

function getFormFieldsByName(form, name) {
	var fel = form.elements.length;
	var arr = new Array();
	for (var x = 0; x < fel; x++) {
		if (form.elements[x].name == name) {
			arr.push(form.elements[x]);
		}
	}
	return arr;
}

function getOptionIndexByValue(select, value) {
	var len = select.options.length;
	for (var x = 0; x < len; x++) {
		if (select.options[x].value == value) {
			return x;
		}
	}
	return -1;
}

function formatPrice(price, currency) {
	var str 		= price.toFixed(2).toString();	
	var spl 		= str.split(/\./);
	var whole		= spl[0];
	var deci		= spl[1];
	var txt_thou 	= ',';
	var txt_deci	= '.';
	var formatted	= '';
	var ctr			= 0;
	
	for (var x = whole.length - 1; x >= 0; x--, ctr++) {
		if (ctr == 3) {
			formatted = txt_thou + formatted;
		}
		formatted = whole.charAt(x) + formatted;
	}
	return formatted + txt_deci + deci + ' ' + currency;
	
}
// Corporate Domain Selection Tool

function CorporateDomainTool
(
	form_dom_id, available_select_id, selected_select_id,
	add_button_id, remove_button_id, num_selected_notify_id,
	est_price_notify_id, add_all_id, remove_all_id, search_id
) {

	this.form 		         = document.getElementById(form_dom_id);
	this.available_select    = document.getElementById(available_select_id);
	this.selected_select     = document.getElementById(selected_select_id);
	this.add_button          = document.getElementById(add_button_id);
	this.remove_button       = document.getElementById(remove_button_id);
	this.num_selected_notify = document.getElementById(num_selected_notify_id);
	this.est_price_notify	 = document.getElementById(est_price_notify_id);
	this.add_all_button		 = document.getElementById(add_all_id);
	this.rm_all_button		 = document.getElementById(remove_all_id);
	this.search_input		 = document.getElementById(search_id);

	this.selectedExt		 = new Array();
	this.extensionIndex		 = new Array();

}

CorporateDomainTool.prototype.onload = function() {
	var listener = this;
	var dn = getFormFieldsByName(this.form, 'domain')[0];
	this.form.onsubmit 				= function() { return listener.onsubmit(); };
	this.add_button.onclick 		= function() { if (dn.onfocus) {dn.onfocus();} return listener.addExtensions(false); };
	this.remove_button.onclick  	= function() { return listener.removeExtensions(false); };
	this.add_all_button.onclick		= function() { if (dn.onfocus) {dn.onfocus();} listener.addExtensions(true); return false; };
	this.rm_all_button.onclick		= function() { listener.removeExtensions(true); return false; };
	this.search_input.onkeypress 	= function(event) { return listener.search(event); };

	dn.onkeypress = function(e) {

		var keyCode = window.event ? window.event.keyCode : e.which ;

		var text = trim(this.value);

		if (keyCode == 8) {
			text = text.substring(0, text.length - 1);
		} else if (keyCode >= 32) {
			text += String.fromCharCode(keyCode);
		}

		if (!text.match(/^[a-z0-9\-]+$/i)) {
			listener.boxErr(this);
			return;
		}
		this.style.backgroundColor = '';
	}
	dn.onblur = function() {
		if (!this.value.match(/^[a-z0-9\-]+$/i)) {
			listener.boxErr(this);
			return;
		}
		this.style.backgroundColor = '';
	};
	dn.onchange = function() { listener.updateDomain(); }


	// do a default update
	this.loadExtensionIndex();

	var len   = this.selected_select.options.length;
	var opt   = null;
	var sld_id= null;
	var ext   = null;
	var price = null;
	var srcopt= null;

	for (var x = 0; x < len; x++) {
		opt = this.selected_select.options[x];
		arr    = opt.value.split(/\:/);
		sld_id = arr[0];
		ext	   = arr[1];
		price  = parseFloat(arr[2]);
		this.selectedExt[sld_id] = price;
		for (key in this.extensionIndex) {
			if (this.extensionIndex[key] == ext) {
				srcopt = this.available_select.options[key];
				srcopt.selected = false;
				srcopt.style.visibility = 'hidden';
				srcopt.style.display = 'none';
				break;
			}
		}
	}

	this.updateTotals();
}

CorporateDomainTool.prototype.onsubmit = function() {
	var rtnval 					= true;
	var required_input 			= new Array(
		getFormFieldsByName(this.form, 'name')[0],
		getFormFieldsByName(this.form, 'company_name')[0],
		getFormFieldsByName(this.form, 'email')[0],
		getFormFieldsByName(this.form, 'phone')[0]
	);

	var len = this.form.elements.length;

	for (var x = 0; x < len; x++) {
		if (this.form.elements[x].onfocus) {
			this.form.elements[x].onfocus();
		}
	}

	for (key in required_input) {
		if (required_input[key].onfocus) {
			required_input[key].onfocus();
		}
		if (trim(required_input[key].value).length < 1) {
			rtnval = false;
			this.boxErr(required_input[key]);
		}
	}

	var dn_box		= getFormFieldsByName(this.form, 'domain')[0];
	var domain_name = trim(dn_box.value);

	if (domain_name.length < 1 || !domain_name.match(/^[a-z0-9\-]+$/)) {
		if (dn_box.onfocus) {
			dn_box.onfocus();
		}
		this.boxErr(dn_box);
		rtnval = false;
	}

	len 			= this.selected_select.options.length;

	if (len < 1) {
		this.boxErr(this.selected_select);
		rtnval = false;
	}

	for (var x = 0; x < len; x++) {
		this.selected_select.options[x].selected=true;
	}

	return rtnval;
}

CorporateDomainTool.prototype.boxErr = function(box) {
	box.style.backgroundColor = '#ffcccc';
	box.onfocus = function() { this.style.backgroundColor = ''; this.style.color = ''; };
}

CorporateDomainTool.prototype.addExtensions = function(add_all) {

	var len = this.available_select.options.length;
	var dn_box          = getFormFieldsByName(this.form, 'domain')[0];

	var opt   = null;
	var nopt  = null;
	var arr	  = null;
	var sld_id= null;
	var ext   = null;
	var price = null;

	for (var x = 0; x < len; x++) {
		opt = this.available_select.options[x];
		if (add_all == true || opt.selected) {
			arr    = opt.value.split(/\:/);
			sld_id = arr[0];
			ext	   = arr[1];
			price  = parseFloat(arr[2]);
			if (this.selectedExt[sld_id] > 0) { continue; }
			nopt   = createDOMElement('option');
			nopt.setAttribute('value', opt.value);
			nopt.innerHTML = dn_box.value+ext + ': ' + formatPrice(price, 'INR');

			this.selected_select.appendChild(nopt);
			this.selectedExt[sld_id] = price;
			opt.selected = false;
			opt.style.visibility = 'hidden';
			opt.style.display = 'none';
			this.selected_select.style.backgroundColor = '';
		}
	}

	this.updateTotals();

	return true;
}

CorporateDomainTool.prototype.removeExtensions = function(remove_all) {
	var len 			= this.selected_select.options.length;
	var opt				= null;
	var avail_idx 		= -1;
	var remove_me		= new Array();

	for (var x = 0; x < len; x++) {
		opt = this.selected_select.options[x];
		if (remove_all == true || opt.selected) {
			avail_idx = getOptionIndexByValue(this.available_select, opt.value);
			if (avail_idx >= 0) {
				this.available_select.options[avail_idx].style.visibility = 'visible';
				this.available_select.options[avail_idx].style.display = '';
				this.available_select.options[avail_idx].selected = false;
			}
			arr    = opt.value.split(/\:/);
			sld_id = arr[0];
			ext	   = arr[1];
			price  = arr[2];
			this.selectedExt[sld_id] = 0;
			remove_me.push(opt);
		}
	}

	for (key in remove_me) {
		remove_me[key].parentNode.removeChild(remove_me[key]);
	}

	this.updateTotals();
}

CorporateDomainTool.prototype.updateTotals = function() {

	var ct    = 0;
	var total = 0;

	for (key in this.selectedExt) {
		if (this.selectedExt[key] > 0) {
			ct++;
			total += this.selectedExt[key];
		}
	}

	murderChildren(this.num_selected_notify);
	murderChildren(this.est_price_notify);
	this.num_selected_notify.appendChild(document.createTextNode(ct));
	this.est_price_notify.appendChild(document.createTextNode(formatPrice(total, 'INR')));
}

CorporateDomainTool.prototype.updateDomain = function() {
	var len 			= this.selected_select.options.length;
	var opt				= null;
	var dn_box          = getFormFieldsByName(this.form, 'domain')[0];
	var sld_id;
	var ext;
	var price;

	for (var x = 0; x < len; x++) {
		opt = this.selected_select.options[x];
		arr    = opt.value.split(/\:/);
		sld_id = arr[0];
		ext	   = arr[1];
		price  = arr[2];
		murderChildren(opt);
		opt.appendChild(document.createTextNode(dn_box.value + ext + ': ' + formatPrice(parseFloat(price), 'INR')));
	}
}

CorporateDomainTool.prototype.search = function(e) {
	if (this.extensionIndex.length < 1) {
		this.loadExtensionIndex();
	}

	var keyCode = window.event ? window.event.keyCode : e.which ;

	var text = trim(this.search_input.value);

	if (keyCode == 8) {
		text = text.substring(0, text.length - 1);
	} else if (keyCode >= 32) {
		text += String.fromCharCode(keyCode);
	}

	if (!text.match(/^[a-z0-9\-.]*$/i)) {
		this.boxErr(this.search_input);
		return true;
	}

	this.search_input.backgroundColor = '';

	if (!text.match(/^\./)) {
		text = '.' + text;
	}

	var ext = '';
	var first_idx = -1;
	for (var key in this.extensionIndex) {
		ext = this.extensionIndex[key];
		if (ext.toLowerCase().search(text) != -1) {
			this.available_select.options[key].selected = true;
			if (first_idx == -1) {
				first_idx = key;
			}
		} else {
			this.available_select.options[key].selected = false;
		}
	}

	// funky way of scrolling the multiselect
	if (first_idx >= 0) {
		this.available_select.options[first_idx].selected = false;
		this.available_select.options[first_idx].selected = true;
	} else {
		this.available_select.options[0].selected = true;
		this.available_select.options[0].selected = false;
	}

	return true;
}

CorporateDomainTool.prototype.loadExtensionIndex = function() {
	var len = this.available_select.options.length;

	var arr		= null;
	var ext		= null;
	var price	= null;
	var sld_id	= null;

	for (var x = 0; x < len; x++) {
		opt = this.available_select.options[x];
		arr    = opt.value.split(/\:/);
		sld_id = arr[0];
		ext	   = arr[1];
		price  = arr[2];
		this.extensionIndex[x] = ext;
	}
}
function CheckAll() {
    this.box_dom_ids = new Array();
    this.checked     = false;
}

CheckAll.prototype.add = function(dom_id) {
    this.box_dom_ids.push(dom_id);
}

CheckAll.prototype.onclick = function() {

    for (key in this.box_dom_ids) {
        var c = document.getElementById(this.box_dom_ids[key]);
        if (c) {
            c.checked = !this.checked;
        }
    }
    
    this.checked = !this.checked;
}

function CheckAllForm(form, clicker)  {
	for (var x = 0; x < form.elements.length; x++) {
		var e=form.elements[x];
		if (e != this && e.type == "checkbox") {
			e.checked = clicker.checked;
		}
	}
	return true;
}

function CheckAllFormByInputName(form, clicker, name, opposite)  {
	for (var x = 0; x < form.elements.length; x++) {
		var e=form.elements[x];
		if (e != this && e.type == "checkbox" && e.name == name) {
			e.checked = clicker.checked;
			if (opposite) {
				e.checked = !e.checked;
			}
		}
	}
	return true;
}function DropDownMenu(ul_dom_id) {
	this.ul_dom_id		= ul_dom_id;
	this.menuItems		= new Array();
	this.parents		= new Array();
	this.initialized	= new Array();
}

DropDownMenu.prototype = {
	
	onload:		function() {
		var c = null, l = this.menuItems.length, x;
		for (x = 0; x < l; x++) {
			c = this.menuItems[x];
			c.init(null);
		}
	},
		
	convertHTMLItem: function(item_id) {
		var item = new DropDownMenuItem('','');
		item.exist_id = item_id;
		this.menuItems.push(item);
		return item;
	},
	
	add: function(i) { this.menuItems.push(i); return i; } 

};

function DropDownMenuItem(url, text, child_ul_class, nofollow) {
	this.url = url;
	this.text = text;
	this.element = null;
	this.child_ul = null;
	this.child_ul_class = child_ul_class;
	this.children = new Array();
	this.exist_id = null;
	this.open = false;
	this.out_timer = null;
	this.nofollow = nofollow;
};

DropDownMenuItem.prototype = {
	add: function(i) {
		this.children.push(i);
		return i;
	},
	init: function(parent) {

		if (this.exist_id) {
			this.element = document.getElementById(this.exist_id);
		} else if (!this.element) { 
		
			this.element = document.createElement('li');
			
			var a = document.createElement('a');
			if (this.url) {
				a.setAttribute('href', this.url);
			} else {
				a.setAttribute('href', '#');
			}
			if (this.nofollow) {
				a.setAttribute('rel','nofollow');
			}
			this.element.onclick = function() { document.location.href = a.href; };
			a.innerHTML = this.text;
			this.element.appendChild(a);
			if (parent) {
				parent.child_ul.appendChild(this.element);
			}
		}

		if (!this.child_ul && this.children.length > 0) {

			this.child_ul = document.createElement('ul');
			this.child_ul.style.display = 'none';
			this.child_ul.style.zIndex  = 100;

			if (this.exist_id && !isIE) {
				this.element.appendChild(this.child_ul);
			} else {
				this.element.insertBefore(this.child_ul, this.element.firstChild);
			}
			if (this.child_ul_class) {
				setCss(this.child_ul, this.child_ul_class + (!this.exist_id ? ' right_dd_menu' : ''));
			} else {
				setCss(this.child_ul, 'sub_dd_menu' + (!this.exist_id ? ' right_dd_menu' : ''));
			}
			
			var listener = this;
			this.element.onmouseover = function() { return listener.hover(); };			
			this.element.onmouseout  = function() { return listener.out(); };
			
			var c = null, x;
			for (x = 0; x < this.children.length; x++) {
				c = this.children[x];
				c.init(this);
			}
		}
	},
	hover:	function() {
		if (this.out_timer) {
			clearInterval(this.out_timer);
			this.out_timer = null;
		}
		if (this.child_ul) {
			this.child_ul.style.display = '';
			this.open = true;
		}
		return true;
	},
	closeChildren: function() {
		var x = 0, l = this.children.length, o;

		for (x = 0; x < l; x++) {
			o = this.children[x];
			o.open = false;
			if (o.child_ul) { o.child_ul.style.display = 'none'; } 
		}
		this.open = false;
		if (this.child_ul) {
			this.child_ul.style.display = 'none';
		}
		
	},
	out: function() {

		if (!this.out_timer) {
			var t= this;
			this.out_timer = setInterval(function() { t.out(); }, 250);
			return;
		}
		clearInterval(this.out_timer);
		this.out_timer = null;

		if (!this.child_ul) { this.open = false; return true; } 
		var x = 0, l = this.children.length, o;

		for (x = 0; x < l; x++) {
			o = this.children[x];
			if (o.open) { return true; } 
		}
		
		this.open = false;
		this.child_ul.style.display = 'none';
		return true;
	}
};
function IDNTable(idn_table_id, search_dom_id) {
	this.table 			= document.getElementById(idn_table_id);
	this.search_box		= document.getElementById(search_dom_id);
}

IDNTable.prototype = {
	
	onload:			function() {
		var tbody = this.table.getElementsByTagName('tbody')[0];
		var tbody_child_ct = tbody.childNodes.length;
		var t     = this;

		for (var x = 0; x < tbody_child_ct; x++) {
			var tr = tbody.childNodes[x];
			if (tr && tr.nodeName.toLowerCase() == 'tr') {
				var tr_child_ct = tr.childNodes.length;
				for (y = 0; y < tr_child_ct; y++) {
					var td = tr.childNodes[y];
					if (td && td.nodeName.toLowerCase() == 'td') {
						td.onclick = function() { t.onclick(this); } 
					}
				}
			}
		}
	},
	
	onclick:		function(element) {
		var c 	= element.innerHTML;
		if (c.replace) {
			c	 	= c.replace(/ /, '');
		}
		this.search_box.value += c;
	}
};
/**
 * Page loading functions
 *
 * $Id: page-load.js,v 1.1 2009/08/27 19:09:18 bwilder Exp $
 */
var cursor = {x:0, y:0};
var last_pos     = {x:0, y:0};
var onload_queue = new Array();
var move_list    = new Array();

// redirect somewhere else
function redir(page) {
    window.location.href = page;
}

function page_load() { 
//  if (window.Event) {
//    document.captureEvents(Event.MOUSEMOVE);
//  }
  document.onmousemove = getXY;
  for (key in onload_queue) {
    var c = onload_queue[key]
    if (!c) { continue; } 
	if (c.onload) { c.onload(); } 
	else if (c.eventOnLoad) { c.eventOnLoad(); } 
  }
  document.onmouseup = function() {
    move_list = new Array();
  }
}

function addOnLoadQueue(item) {
    onload_queue[onload_queue.length] = item;
}

var change_x = 0;
var change_y = 0;

function getXY(e) {
    e = e || window.event;
    
    last_pos.x    = cursor.x;
    last_pos.y    = cursor.y;

    if (window.Event) {
        cursor.x = e.pageX;
        cursor.y = e.pageY;
    } 
    else {
        var de = document.documentElement;
        var b = document.body;
        cursor.x = e.clientX + 
            (de.scrollLeft || b.scrollLeft) - (de.clientLeft || 0);
        cursor.y = e.clientY + 
            (de.scrollTop || b.scrollTop) - (de.clientTop || 0);
    }
    
    change_x += cursor.x - last_pos.x;
    change_y += cursor.y - last_pos.y;

}

function move_windows() {
    if (move_list.length > 0) {
        for (key in move_list) {
            move_list[key].move(change_x, change_y);
        }
    } 
    change_x = 0;
    change_y = 0;
    if (move_list.length < 1) {
        return;
    }    
    setTimeout('move_windows()', 75);
}

function addMoveQueue(a) {
    change_x = 0;
    change_y = 0;
    move_list[move_list.length] = a;
    setTimeout('move_windows()', 75);    
}function DomainSearch(domain_name, url) {
	var listener		= this;
	this.url			= url;
	this.domain_name	= domain_name;
	this.ajax			= new AjaxConnection;
	this.ajax.processer = function(root_node, a) {
		xmlToDom(null, root_node);
	}
	this.tries			   = 0;
	this.ajax.errorHandler = function(text,aj){listener.errorHandler(text);}
}

DomainSearch.prototype = {

	onload:			function() {
		this.run();
	},
	
	run:			function() {
		this.tries++;
		this.ajax.Connect(this.url + (!this.url.match(/\?/) ? '?' : '&') + 'try=' +this.tries);
	},
	
	errorHandler:	function(text) {
		if (this.tries < 2) {
			this.run();
			return ;
		}
		
		if (text.match(/(Failed parsing XML Document)|(Error connecting to Ajax)/)) {
			text = "There has been a temporary server error; please try again later";
		}
		
		// Display the error instead of the loading image
		var line = document.getElementById(this.domain_name);
		if (line) {
			var image_list = line.getElementsByTagName("img");
			var image_found = false;
			for (var x = 0; x < image_list.length; x++) {
				if (image_list[x].src.match(/loading/)) {
					image_found = true;
					var text_node = document.createTextNode(text);
					image_list[x].parentNode.insertBefore(text_node, image_list[x]);
					image_list[x].parentNode.removeChild(image_list[x]);
					break;
				}
			}
			if (image_found == false) {
				alert(text);
			}
		}
	}
		
};function PricingHider() {
	this.options	   = new Array();
}

PricingHider.prototype.addCurrency = function(currency, dom_id) {
	var a = new function() {};
	a.currency = currency;
	a.dom_id = dom_id;
	this.options.push(a);
};

PricingHider.prototype.init = function(default_on) {
	this.change(default_on);
};

PricingHider.prototype.change = function(currency) {
	var ct = this.options.length;
	for (var x = 0; x < ct; x++) {
		var opt = this.options[x];
		var d;
		if ((d = document.getElementById(opt.dom_id))) {
			d.style.display = opt.currency != currency ? 'none' : '';
		}
	}	
};
(function(){
/*
 * jQuery 1.2.3 - New Wave Javascript
 *
 * Copyright (c) 2008 John Resig (jquery.com)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * $Date: 2009/08/05 17:57:08 $
 * $Rev: 4660 $
 */

// Map over jQuery in case of overwrite
if ( window.jQuery )
	var _jQuery = window.jQuery;

var jQuery = window.jQuery = function( selector, context ) {
	// The jQuery object is actually just the init constructor 'enhanced'
	return new jQuery.prototype.init( selector, context );
};

// Map over the $ in case of overwrite
if ( window.$ )
	var _$ = window.$;
	
// Map the jQuery namespace to the '$' one
window.$ = jQuery;

// A simple way to check for HTML strings or ID strings
// (both of which we optimize for)
var quickExpr = /^[^<]*(<(.|\s)+>)[^>]*$|^#(\w+)$/;

// Is it a simple selector
var isSimple = /^.[^:#\[\.]*$/;

jQuery.fn = jQuery.prototype = {
	init: function( selector, context ) {
		// Make sure that a selection was provided
		selector = selector || document;

		// Handle $(DOMElement)
		if ( selector.nodeType ) {
			this[0] = selector;
			this.length = 1;
			return this;

		// Handle HTML strings
		} else if ( typeof selector == "string" ) {
			// Are we dealing with HTML string or an ID?
			var match = quickExpr.exec( selector );

			// Verify a match, and that no context was specified for #id
			if ( match && (match[1] || !context) ) {

				// HANDLE: $(html) -> $(array)
				if ( match[1] )
					selector = jQuery.clean( [ match[1] ], context );

				// HANDLE: $("#id")
				else {
					var elem = document.getElementById( match[3] );

					// Make sure an element was located
					if ( elem )
						// Handle the case where IE and Opera return items
						// by name instead of ID
						if ( elem.id != match[3] )
							return jQuery().find( selector );

						// Otherwise, we inject the element directly into the jQuery object
						else {
							this[0] = elem;
							this.length = 1;
							return this;
						}

					else
						selector = [];
				}

			// HANDLE: $(expr, [context])
			// (which is just equivalent to: $(content).find(expr)
			} else
				return new jQuery( context ).find( selector );

		// HANDLE: $(function)
		// Shortcut for document ready
		} else if ( jQuery.isFunction( selector ) )
			return new jQuery( document )[ jQuery.fn.ready ? "ready" : "load" ]( selector );

		return this.setArray(
			// HANDLE: $(array)
			selector.constructor == Array && selector ||

			// HANDLE: $(arraylike)
			// Watch for when an array-like object, contains DOM nodes, is passed in as the selector
			(selector.jquery || selector.length && selector != window && !selector.nodeType && selector[0] != undefined && selector[0].nodeType) && jQuery.makeArray( selector ) ||

			// HANDLE: $(*)
			[ selector ] );
	},
	
	// The current version of jQuery being used
	jquery: "1.2.3",

	// The number of elements contained in the matched element set
	size: function() {
		return this.length;
	},
	
	// The number of elements contained in the matched element set
	length: 0,

	// Get the Nth element in the matched element set OR
	// Get the whole matched element set as a clean array
	get: function( num ) {
		return num == undefined ?

			// Return a 'clean' array
			jQuery.makeArray( this ) :

			// Return just the object
			this[ num ];
	},
	
	// Take an array of elements and push it onto the stack
	// (returning the new matched element set)
	pushStack: function( elems ) {
		// Build a new jQuery matched element set
		var ret = jQuery( elems );

		// Add the old object onto the stack (as a reference)
		ret.prevObject = this;

		// Return the newly-formed element set
		return ret;
	},
	
	// Force the current matched set of elements to become
	// the specified array of elements (destroying the stack in the process)
	// You should use pushStack() in order to do this, but maintain the stack
	setArray: function( elems ) {
		// Resetting the length to 0, then using the native Array push
		// is a super-fast way to populate an object with array-like properties
		this.length = 0;
		Array.prototype.push.apply( this, elems );
		
		return this;
	},

	// Execute a callback for every element in the matched set.
	// (You can seed the arguments with an array of args, but this is
	// only used internally.)
	each: function( callback, args ) {
		return jQuery.each( this, callback, args );
	},

	// Determine the position of an element within 
	// the matched set of elements
	index: function( elem ) {
		var ret = -1;

		// Locate the position of the desired element
		this.each(function(i){
			if ( this == elem )
				ret = i;
		});

		return ret;
	},

	attr: function( name, value, type ) {
		var options = name;
		
		// Look for the case where we're accessing a style value
		if ( name.constructor == String )
			if ( value == undefined )
				return this.length && jQuery[ type || "attr" ]( this[0], name ) || undefined;

			else {
				options = {};
				options[ name ] = value;
			}
		
		// Check to see if we're setting style values
		return this.each(function(i){
			// Set all the styles
			for ( name in options )
				jQuery.attr(
					type ?
						this.style :
						this,
					name, jQuery.prop( this, options[ name ], type, i, name )
				);
		});
	},

	css: function( key, value ) {
		// ignore negative width and height values
		if ( (key == 'width' || key == 'height') && parseFloat(value) < 0 )
			value = undefined;
		return this.attr( key, value, "curCSS" );
	},

	text: function( text ) {
		if ( typeof text != "object" && text != null )
			return this.empty().append( (this[0] && this[0].ownerDocument || document).createTextNode( text ) );

		var ret = "";

		jQuery.each( text || this, function(){
			jQuery.each( this.childNodes, function(){
				if ( this.nodeType != 8 )
					ret += this.nodeType != 1 ?
						this.nodeValue :
						jQuery.fn.text( [ this ] );
			});
		});

		return ret;
	},

	wrapAll: function( html ) {
		if ( this[0] )
			// The elements to wrap the target around
			jQuery( html, this[0].ownerDocument )
				.clone()
				.insertBefore( this[0] )
				.map(function(){
					var elem = this;

					while ( elem.firstChild )
						elem = elem.firstChild;

					return elem;
				})
				.append(this);

		return this;
	},

	wrapInner: function( html ) {
		return this.each(function(){
			jQuery( this ).contents().wrapAll( html );
		});
	},

	wrap: function( html ) {
		return this.each(function(){
			jQuery( this ).wrapAll( html );
		});
	},

	append: function() {
		return this.domManip(arguments, true, false, function(elem){
			if (this.nodeType == 1)
				this.appendChild( elem );
		});
	},

	prepend: function() {
		return this.domManip(arguments, true, true, function(elem){
			if (this.nodeType == 1)
				this.insertBefore( elem, this.firstChild );
		});
	},
	
	before: function() {
		return this.domManip(arguments, false, false, function(elem){
			this.parentNode.insertBefore( elem, this );
		});
	},

	after: function() {
		return this.domManip(arguments, false, true, function(elem){
			this.parentNode.insertBefore( elem, this.nextSibling );
		});
	},

	end: function() {
		return this.prevObject || jQuery( [] );
	},

	find: function( selector ) {
		var elems = jQuery.map(this, function(elem){
			return jQuery.find( selector, elem );
		});

		return this.pushStack( /[^+>] [^+>]/.test( selector ) || selector.indexOf("..") > -1 ?
			jQuery.unique( elems ) :
			elems );
	},

	clone: function( events ) {
		// Do the clone
		var ret = this.map(function(){
			if ( jQuery.browser.msie && !jQuery.isXMLDoc(this) ) {
				// IE copies events bound via attachEvent when
				// using cloneNode. Calling detachEvent on the
				// clone will also remove the events from the orignal
				// In order to get around this, we use innerHTML.
				// Unfortunately, this means some modifications to 
				// attributes in IE that are actually only stored 
				// as properties will not be copied (such as the
				// the name attribute on an input).
				var clone = this.cloneNode(true),
					container = document.createElement("div");
				container.appendChild(clone);
				return jQuery.clean([container.innerHTML])[0];
			} else
				return this.cloneNode(true);
		});

		// Need to set the expando to null on the cloned set if it exists
		// removeData doesn't work here, IE removes it from the original as well
		// this is primarily for IE but the data expando shouldn't be copied over in any browser
		var clone = ret.find("*").andSelf().each(function(){
			if ( this[ expando ] != undefined )
				this[ expando ] = null;
		});
		
		// Copy the events from the original to the clone
		if ( events === true )
			this.find("*").andSelf().each(function(i){
				if (this.nodeType == 3)
					return;
				var events = jQuery.data( this, "events" );

				for ( var type in events )
					for ( var handler in events[ type ] )
						jQuery.event.add( clone[ i ], type, events[ type ][ handler ], events[ type ][ handler ].data );
			});

		// Return the cloned set
		return ret;
	},

	filter: function( selector ) {
		return this.pushStack(
			jQuery.isFunction( selector ) &&
			jQuery.grep(this, function(elem, i){
				return selector.call( elem, i );
			}) ||

			jQuery.multiFilter( selector, this ) );
	},

	not: function( selector ) {
		if ( selector.constructor == String )
			// test special case where just one selector is passed in
			if ( isSimple.test( selector ) )
				return this.pushStack( jQuery.multiFilter( selector, this, true ) );
			else
				selector = jQuery.multiFilter( selector, this );

		var isArrayLike = selector.length && selector[selector.length - 1] !== undefined && !selector.nodeType;
		return this.filter(function() {
			return isArrayLike ? jQuery.inArray( this, selector ) < 0 : this != selector;
		});
	},

	add: function( selector ) {
		return !selector ? this : this.pushStack( jQuery.merge( 
			this.get(),
			selector.constructor == String ? 
				jQuery( selector ).get() :
				selector.length != undefined && (!selector.nodeName || jQuery.nodeName(selector, "form")) ?
					selector : [selector] ) );
	},

	is: function( selector ) {
		return selector ?
			jQuery.multiFilter( selector, this ).length > 0 :
			false;
	},

	hasClass: function( selector ) {
		return this.is( "." + selector );
	},
	
	val: function( value ) {
		if ( value == undefined ) {

			if ( this.length ) {
				var elem = this[0];

				// We need to handle select boxes special
				if ( jQuery.nodeName( elem, "select" ) ) {
					var index = elem.selectedIndex,
						values = [],
						options = elem.options,
						one = elem.type == "select-one";
					
					// Nothing was selected
					if ( index < 0 )
						return null;

					// Loop through all the selected options
					for ( var i = one ? index : 0, max = one ? index + 1 : options.length; i < max; i++ ) {
						var option = options[ i ];

						if ( option.selected ) {
							// Get the specifc value for the option
							value = jQuery.browser.msie && !option.attributes.value.specified ? option.text : option.value;
							
							// We don't need an array for one selects
							if ( one )
								return value;
							
							// Multi-Selects return an array
							values.push( value );
						}
					}
					
					return values;
					
				// Everything else, we just grab the value
				} else
					return (this[0].value || "").replace(/\r/g, "");

			}

			return undefined;
		}

		return this.each(function(){
			if ( this.nodeType != 1 )
				return;

			if ( value.constructor == Array && /radio|checkbox/.test( this.type ) )
				this.checked = (jQuery.inArray(this.value, value) >= 0 ||
					jQuery.inArray(this.name, value) >= 0);

			else if ( jQuery.nodeName( this, "select" ) ) {
				var values = value.constructor == Array ?
					value :
					[ value ];

				jQuery( "option", this ).each(function(){
					this.selected = (jQuery.inArray( this.value, values ) >= 0 ||
						jQuery.inArray( this.text, values ) >= 0);
				});

				if ( !values.length )
					this.selectedIndex = -1;

			} else
				this.value = value;
		});
	},
	
	html: function( value ) {
		return value == undefined ?
			(this.length ?
				this[0].innerHTML :
				null) :
			this.empty().append( value );
	},

	replaceWith: function( value ) {
		return this.after( value ).remove();
	},

	eq: function( i ) {
		return this.slice( i, i + 1 );
	},

	slice: function() {
		return this.pushStack( Array.prototype.slice.apply( this, arguments ) );
	},

	map: function( callback ) {
		return this.pushStack( jQuery.map(this, function(elem, i){
			return callback.call( elem, i, elem );
		}));
	},

	andSelf: function() {
		return this.add( this.prevObject );
	},

	data: function( key, value ){
		var parts = key.split(".");
		parts[1] = parts[1] ? "." + parts[1] : "";

		if ( value == null ) {
			var data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]);
			
			if ( data == undefined && this.length )
				data = jQuery.data( this[0], key );

			return data == null && parts[1] ?
				this.data( parts[0] ) :
				data;
		} else
			return this.trigger("setData" + parts[1] + "!", [parts[0], value]).each(function(){
				jQuery.data( this, key, value );
			});
	},

	removeData: function( key ){
		return this.each(function(){
			jQuery.removeData( this, key );
		});
	},
	
	domManip: function( args, table, reverse, callback ) {
		var clone = this.length > 1, elems; 

		return this.each(function(){
			if ( !elems ) {
				elems = jQuery.clean( args, this.ownerDocument );

				if ( reverse )
					elems.reverse();
			}

			var obj = this;

			if ( table && jQuery.nodeName( this, "table" ) && jQuery.nodeName( elems[0], "tr" ) )
				obj = this.getElementsByTagName("tbody")[0] || this.appendChild( this.ownerDocument.createElement("tbody") );

			var scripts = jQuery( [] );

			jQuery.each(elems, function(){
				var elem = clone ?
					jQuery( this ).clone( true )[0] :
					this;

				// execute all scripts after the elements have been injected
				if ( jQuery.nodeName( elem, "script" ) ) {
					scripts = scripts.add( elem );
				} else {
					// Remove any inner scripts for later evaluation
					if ( elem.nodeType == 1 )
						scripts = scripts.add( jQuery( "script", elem ).remove() );

					// Inject the elements into the document
					callback.call( obj, elem );
				}
			});

			scripts.each( evalScript );
		});
	}
};

// Give the init function the jQuery prototype for later instantiation
jQuery.prototype.init.prototype = jQuery.prototype;

function evalScript( i, elem ) {
	if ( elem.src )
		jQuery.ajax({
			url: elem.src,
			async: false,
			dataType: "script"
		});

	else
		jQuery.globalEval( elem.text || elem.textContent || elem.innerHTML || "" );

	if ( elem.parentNode )
		elem.parentNode.removeChild( elem );
}

jQuery.extend = jQuery.fn.extend = function() {
	// copy reference to target object
	var target = arguments[0] || {}, i = 1, length = arguments.length, deep = false, options;

	// Handle a deep copy situation
	if ( target.constructor == Boolean ) {
		deep = target;
		target = arguments[1] || {};
		// skip the boolean and the target
		i = 2;
	}

	// Handle case when target is a string or something (possible in deep copy)
	if ( typeof target != "object" && typeof target != "function" )
		target = {};

	// extend jQuery itself if only one argument is passed
	if ( length == 1 ) {
		target = this;
		i = 0;
	}

	for ( ; i < length; i++ )
		// Only deal with non-null/undefined values
		if ( (options = arguments[ i ]) != null )
			// Extend the base object
			for ( var name in options ) {
				// Prevent never-ending loop
				if ( target === options[ name ] )
					continue;

				// Recurse if we're merging object values
				if ( deep && options[ name ] && typeof options[ name ] == "object" && target[ name ] && !options[ name ].nodeType )
					target[ name ] = jQuery.extend( target[ name ], options[ name ] );

				// Don't bring in undefined values
				else if ( options[ name ] != undefined )
					target[ name ] = options[ name ];

			}

	// Return the modified object
	return target;
};

var expando = "jQuery" + (new Date()).getTime(), uuid = 0, windowData = {};

// exclude the following css properties to add px
var exclude = /z-?index|font-?weight|opacity|zoom|line-?height/i;

jQuery.extend({
	noConflict: function( deep ) {
		window.$ = _$;

		if ( deep )
			window.jQuery = _jQuery;

		return jQuery;
	},

	// See test/unit/core.js for details concerning this function.
	isFunction: function( fn ) {
		return !!fn && typeof fn != "string" && !fn.nodeName && 
			fn.constructor != Array && /function/i.test( fn + "" );
	},
	
	// check if an element is in a (or is an) XML document
	isXMLDoc: function( elem ) {
		return elem.documentElement && !elem.body ||
			elem.tagName && elem.ownerDocument && !elem.ownerDocument.body;
	},

	// Evalulates a script in a global context
	globalEval: function( data ) {
		data = jQuery.trim( data );

		if ( data ) {
			// Inspired by code by Andrea Giammarchi
			// http://webreflection.blogspot.com/2007/08/global-scope-evaluation-and-dom.html
			var head = document.getElementsByTagName("head")[0] || document.documentElement,
				script = document.createElement("script");

			script.type = "text/javascript";
			if ( jQuery.browser.msie )
				script.text = data;
			else
				script.appendChild( document.createTextNode( data ) );

			head.appendChild( script );
			head.removeChild( script );
		}
	},

	nodeName: function( elem, name ) {
		return elem.nodeName && elem.nodeName.toUpperCase() == name.toUpperCase();
	},
	
	cache: {},
	
	data: function( elem, name, data ) {
		elem = elem == window ?
			windowData :
			elem;

		var id = elem[ expando ];

		// Compute a unique ID for the element
		if ( !id ) 
			id = elem[ expando ] = ++uuid;

		// Only generate the data cache if we're
		// trying to access or manipulate it
		if ( name && !jQuery.cache[ id ] )
			jQuery.cache[ id ] = {};
		
		// Prevent overriding the named cache with undefined values
		if ( data != undefined )
			jQuery.cache[ id ][ name ] = data;
		
		// Return the named cache data, or the ID for the element	
		return name ?
			jQuery.cache[ id ][ name ] :
			id;
	},
	
	removeData: function( elem, name ) {
		elem = elem == window ?
			windowData :
			elem;

		var id = elem[ expando ];

		// If we want to remove a specific section of the element's data
		if ( name ) {
			if ( jQuery.cache[ id ] ) {
				// Remove the section of cache data
				delete jQuery.cache[ id ][ name ];

				// If we've removed all the data, remove the element's cache
				name = "";

				for ( name in jQuery.cache[ id ] )
					break;

				if ( !name )
					jQuery.removeData( elem );
			}

		// Otherwise, we want to remove all of the element's data
		} else {
			// Clean up the element expando
			try {
				delete elem[ expando ];
			} catch(e){
				// IE has trouble directly removing the expando
				// but it's ok with using removeAttribute
				if ( elem.removeAttribute )
					elem.removeAttribute( expando );
			}

			// Completely remove the data cache
			delete jQuery.cache[ id ];
		}
	},

	// args is for internal usage only
	each: function( object, callback, args ) {
		if ( args ) {
			if ( object.length == undefined ) {
				for ( var name in object )
					if ( callback.apply( object[ name ], args ) === false )
						break;
			} else
				for ( var i = 0, length = object.length; i < length; i++ )
					if ( callback.apply( object[ i ], args ) === false )
						break;

		// A special, fast, case for the most common use of each
		} else {
			if ( object.length == undefined ) {
				for ( var name in object )
					if ( callback.call( object[ name ], name, object[ name ] ) === false )
						break;
			} else
				for ( var i = 0, length = object.length, value = object[0]; 
					i < length && callback.call( value, i, value ) !== false; value = object[++i] ){}
		}

		return object;
	},
	
	prop: function( elem, value, type, i, name ) {
			// Handle executable functions
			if ( jQuery.isFunction( value ) )
				value = value.call( elem, i );
				
			// Handle passing in a number to a CSS property
			return value && value.constructor == Number && type == "curCSS" && !exclude.test( name ) ?
				value + "px" :
				value;
	},

	className: {
		// internal only, use addClass("class")
		add: function( elem, classNames ) {
			jQuery.each((classNames || "").split(/\s+/), function(i, className){
				if ( elem.nodeType == 1 && !jQuery.className.has( elem.className, className ) )
					elem.className += (elem.className ? " " : "") + className;
			});
		},

		// internal only, use removeClass("class")
		remove: function( elem, classNames ) {
			if (elem.nodeType == 1)
				elem.className = classNames != undefined ?
					jQuery.grep(elem.className.split(/\s+/), function(className){
						return !jQuery.className.has( classNames, className );	
					}).join(" ") :
					"";
		},

		// internal only, use is(".class")
		has: function( elem, className ) {
			return jQuery.inArray( className, (elem.className || elem).toString().split(/\s+/) ) > -1;
		}
	},

	// A method for quickly swapping in/out CSS properties to get correct calculations
	swap: function( elem, options, callback ) {
		var old = {};
		// Remember the old values, and insert the new ones
		for ( var name in options ) {
			old[ name ] = elem.style[ name ];
			elem.style[ name ] = options[ name ];
		}

		callback.call( elem );

		// Revert the old values
		for ( var name in options )
			elem.style[ name ] = old[ name ];
	},

	css: function( elem, name, force ) {
		if ( name == "width" || name == "height" ) {
			var val, props = { position: "absolute", visibility: "hidden", display:"block" }, which = name == "width" ? [ "Left", "Right" ] : [ "Top", "Bottom" ];
		
			function getWH() {
				val = name == "width" ? elem.offsetWidth : elem.offsetHeight;
				var padding = 0, border = 0;
				jQuery.each( which, function() {
					padding += parseFloat(jQuery.curCSS( elem, "padding" + this, true)) || 0;
					border += parseFloat(jQuery.curCSS( elem, "border" + this + "Width", true)) || 0;
				});
				val -= Math.round(padding + border);
			}
		
			if ( jQuery(elem).is(":visible") )
				getWH();
			else
				jQuery.swap( elem, props, getWH );
			
			return Math.max(0, val);
		}
		
		return jQuery.curCSS( elem, name, force );
	},

	curCSS: function( elem, name, force ) {
		var ret;

		// A helper method for determining if an element's values are broken
		function color( elem ) {
			if ( !jQuery.browser.safari )
				return false;

			var ret = document.defaultView.getComputedStyle( elem, null );
			return !ret || ret.getPropertyValue("color") == "";
		}

		// We need to handle opacity special in IE
		if ( name == "opacity" && jQuery.browser.msie ) {
			ret = jQuery.attr( elem.style, "opacity" );

			return ret == "" ?
				"1" :
				ret;
		}
		// Opera sometimes will give the wrong display answer, this fixes it, see #2037
		if ( jQuery.browser.opera && name == "display" ) {
			var save = elem.style.outline;
			elem.style.outline = "0 solid black";
			elem.style.outline = save;
		}
		
		// Make sure we're using the right name for getting the float value
		if ( name.match( /float/i ) )
			name = styleFloat;

		if ( !force && elem.style && elem.style[ name ] )
			ret = elem.style[ name ];

		else if ( document.defaultView && document.defaultView.getComputedStyle ) {

			// Only "float" is needed here
			if ( name.match( /float/i ) )
				name = "float";

			name = name.replace( /([A-Z])/g, "-$1" ).toLowerCase();

			var getComputedStyle = document.defaultView.getComputedStyle( elem, null );

			if ( getComputedStyle && !color( elem ) )
				ret = getComputedStyle.getPropertyValue( name );

			// If the element isn't reporting its values properly in Safari
			// then some display: none elements are involved
			else {
				var swap = [], stack = [];

				// Locate all of the parent display: none elements
				for ( var a = elem; a && color(a); a = a.parentNode )
					stack.unshift(a);

				// Go through and make them visible, but in reverse
				// (It would be better if we knew the exact display type that they had)
				for ( var i = 0; i < stack.length; i++ )
					if ( color( stack[ i ] ) ) {
						swap[ i ] = stack[ i ].style.display;
						stack[ i ].style.display = "block";
					}

				// Since we flip the display style, we have to handle that
				// one special, otherwise get the value
				ret = name == "display" && swap[ stack.length - 1 ] != null ?
					"none" :
					( getComputedStyle && getComputedStyle.getPropertyValue( name ) ) || "";

				// Finally, revert the display styles back
				for ( var i = 0; i < swap.length; i++ )
					if ( swap[ i ] != null )
						stack[ i ].style.display = swap[ i ];
			}

			// We should always get a number back from opacity
			if ( name == "opacity" && ret == "" )
				ret = "1";

		} else if ( elem.currentStyle ) {
			var camelCase = name.replace(/\-(\w)/g, function(all, letter){
				return letter.toUpperCase();
			});

			ret = elem.currentStyle[ name ] || elem.currentStyle[ camelCase ];

			// From the awesome hack by Dean Edwards
			// http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291

			// If we're not dealing with a regular pixel number
			// but a number that has a weird ending, we need to convert it to pixels
			if ( !/^\d+(px)?$/i.test( ret ) && /^\d/.test( ret ) ) {
				// Remember the original values
				var style = elem.style.left, runtimeStyle = elem.runtimeStyle.left;

				// Put in the new values to get a computed value out
				elem.runtimeStyle.left = elem.currentStyle.left;
				elem.style.left = ret || 0;
				ret = elem.style.pixelLeft + "px";

				// Revert the changed values
				elem.style.left = style;
				elem.runtimeStyle.left = runtimeStyle;
			}
		}

		return ret;
	},
	
	clean: function( elems, context ) {
		var ret = [];
		context = context || document;
		// !context.createElement fails in IE with an error but returns typeof 'object'
		if (typeof context.createElement == 'undefined') 
			context = context.ownerDocument || context[0] && context[0].ownerDocument || document;

		jQuery.each(elems, function(i, elem){
			if ( !elem )
				return;

			if ( elem.constructor == Number )
				elem = elem.toString();
			
			// Convert html string into DOM nodes
			if ( typeof elem == "string" ) {
				// Fix "XHTML"-style tags in all browsers
				elem = elem.replace(/(<(\w+)[^>]*?)\/>/g, function(all, front, tag){
					return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i) ?
						all :
						front + "></" + tag + ">";
				});

				// Trim whitespace, otherwise indexOf won't work as expected
				var tags = jQuery.trim( elem ).toLowerCase(), div = context.createElement("div");

				var wrap =
					// option or optgroup
					!tags.indexOf("<opt") &&
					[ 1, "<select multiple='multiple'>", "</select>" ] ||
					
					!tags.indexOf("<leg") &&
					[ 1, "<fieldset>", "</fieldset>" ] ||
					
					tags.match(/^<(thead|tbody|tfoot|colg|cap)/) &&
					[ 1, "<table>", "</table>" ] ||
					
					!tags.indexOf("<tr") &&
					[ 2, "<table><tbody>", "</tbody></table>" ] ||
					
				 	// <thead> matched above
					(!tags.indexOf("<td") || !tags.indexOf("<th")) &&
					[ 3, "<table><tbody><tr>", "</tr></tbody></table>" ] ||
					
					!tags.indexOf("<col") &&
					[ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ] ||

					// IE can't serialize <link> and <script> tags normally
					jQuery.browser.msie &&
					[ 1, "div<div>", "</div>" ] ||
					
					[ 0, "", "" ];

				// Go to html and back, then peel off extra wrappers
				div.innerHTML = wrap[1] + elem + wrap[2];
				
				// Move to the right depth
				while ( wrap[0]-- )
					div = div.lastChild;
				
				// Remove IE's autoinserted <tbody> from table fragments
				if ( jQuery.browser.msie ) {
					
					// String was a <table>, *may* have spurious <tbody>
					var tbody = !tags.indexOf("<table") && tags.indexOf("<tbody") < 0 ?
						div.firstChild && div.firstChild.childNodes :
						
						// String was a bare <thead> or <tfoot>
						wrap[1] == "<table>" && tags.indexOf("<tbody") < 0 ?
							div.childNodes :
							[];
				
					for ( var j = tbody.length - 1; j >= 0 ; --j )
						if ( jQuery.nodeName( tbody[ j ], "tbody" ) && !tbody[ j ].childNodes.length )
							tbody[ j ].parentNode.removeChild( tbody[ j ] );
					
					// IE completely kills leading whitespace when innerHTML is used	
					if ( /^\s/.test( elem ) )	
						div.insertBefore( context.createTextNode( elem.match(/^\s*/)[0] ), div.firstChild );
				
				}
				
				elem = jQuery.makeArray( div.childNodes );
			}

			if ( elem.length === 0 && (!jQuery.nodeName( elem, "form" ) && !jQuery.nodeName( elem, "select" )) )
				return;

			if ( elem[0] == undefined || jQuery.nodeName( elem, "form" ) || elem.options )
				ret.push( elem );

			else
				ret = jQuery.merge( ret, elem );

		});

		return ret;
	},
	
	attr: function( elem, name, value ) {
		// don't set attributes on text and comment nodes
		if (!elem || elem.nodeType == 3 || elem.nodeType == 8)
			return undefined;

		var fix = jQuery.isXMLDoc( elem ) ?
			{} :
			jQuery.props;

		// Safari mis-reports the default selected property of a hidden option
		// Accessing the parent's selectedIndex property fixes it
		if ( name == "selected" && jQuery.browser.safari )
			elem.parentNode.selectedIndex;
		
		// Certain attributes only work when accessed via the old DOM 0 way
		if ( fix[ name ] ) {
			if ( value != undefined )
				elem[ fix[ name ] ] = value;

			return elem[ fix[ name ] ];

		} else if ( jQuery.browser.msie && name == "style" )
			return jQuery.attr( elem.style, "cssText", value );

		else if ( value == undefined && jQuery.browser.msie && jQuery.nodeName( elem, "form" ) && (name == "action" || name == "method") )
			return elem.getAttributeNode( name ).nodeValue;

		// IE elem.getAttribute passes even for style
		else if ( elem.tagName ) {

			if ( value != undefined ) {
				// We can't allow the type property to be changed (since it causes problems in IE)
				if ( name == "type" && jQuery.nodeName( elem, "input" ) && elem.parentNode )
					throw "type property can't be changed";

				// convert the value to a string (all browsers do this but IE) see #1070
				elem.setAttribute( name, "" + value );
			}

			if ( jQuery.browser.msie && /href|src/.test( name ) && !jQuery.isXMLDoc( elem ) ) 
				return elem.getAttribute( name, 2 );

			return elem.getAttribute( name );

		// elem is actually elem.style ... set the style
		} else {
			// IE actually uses filters for opacity
			if ( name == "opacity" && jQuery.browser.msie ) {
				if ( value != undefined ) {
					// IE has trouble with opacity if it does not have layout
					// Force it by setting the zoom level
					elem.zoom = 1; 
	
					// Set the alpha filter to set the opacity
					elem.filter = (elem.filter || "").replace( /alpha\([^)]*\)/, "" ) +
						(parseFloat( value ).toString() == "NaN" ? "" : "alpha(opacity=" + value * 100 + ")");
				}
	
				return elem.filter && elem.filter.indexOf("opacity=") >= 0 ?
					(parseFloat( elem.filter.match(/opacity=([^)]*)/)[1] ) / 100).toString() :
					"";
			}

			name = name.replace(/-([a-z])/ig, function(all, letter){
				return letter.toUpperCase();
			});

			if ( value != undefined )
				elem[ name ] = value;

			return elem[ name ];
		}
	},
	
	trim: function( text ) {
		return (text || "").replace( /^\s+|\s+$/g, "" );
	},

	makeArray: function( array ) {
		var ret = [];

		// Need to use typeof to fight Safari childNodes crashes
		if ( typeof array != "array" )
			for ( var i = 0, length = array.length; i < length; i++ )
				ret.push( array[ i ] );
		else
			ret = array.slice( 0 );

		return ret;
	},

	inArray: function( elem, array ) {
		for ( var i = 0, length = array.length; i < length; i++ )
			if ( array[ i ] == elem )
				return i;

		return -1;
	},

	merge: function( first, second ) {
		// We have to loop this way because IE & Opera overwrite the length
		// expando of getElementsByTagName

		// Also, we need to make sure that the correct elements are being returned
		// (IE returns comment nodes in a '*' query)
		if ( jQuery.browser.msie ) {
			for ( var i = 0; second[ i ]; i++ )
				if ( second[ i ].nodeType != 8 )
					first.push( second[ i ] );

		} else
			for ( var i = 0; second[ i ]; i++ )
				first.push( second[ i ] );

		return first;
	},

	unique: function( array ) {
		var ret = [], done = {};

		try {

			for ( var i = 0, length = array.length; i < length; i++ ) {
				var id = jQuery.data( array[ i ] );

				if ( !done[ id ] ) {
					done[ id ] = true;
					ret.push( array[ i ] );
				}
			}

		} catch( e ) {
			ret = array;
		}

		return ret;
	},

	grep: function( elems, callback, inv ) {
		var ret = [];

		// Go through the array, only saving the items
		// that pass the validator function
		for ( var i = 0, length = elems.length; i < length; i++ )
			if ( !inv && callback( elems[ i ], i ) || inv && !callback( elems[ i ], i ) )
				ret.push( elems[ i ] );

		return ret;
	},

	map: function( elems, callback ) {
		var ret = [];

		// Go through the array, translating each of the items to their
		// new value (or values).
		for ( var i = 0, length = elems.length; i < length; i++ ) {
			var value = callback( elems[ i ], i );

			if ( value !== null && value != undefined ) {
				if ( value.constructor != Array )
					value = [ value ];

				ret = ret.concat( value );
			}
		}

		return ret;
	}
});

var userAgent = navigator.userAgent.toLowerCase();

// Figure out what browser is being used
jQuery.browser = {
	version: (userAgent.match( /.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/ ) || [])[1],
	safari: /webkit/.test( userAgent ),
	opera: /opera/.test( userAgent ),
	msie: /msie/.test( userAgent ) && !/opera/.test( userAgent ),
	mozilla: /mozilla/.test( userAgent ) && !/(compatible|webkit)/.test( userAgent )
};

var styleFloat = jQuery.browser.msie ?
	"styleFloat" :
	"cssFloat";
	
jQuery.extend({
	// Check to see if the W3C box model is being used
	boxModel: !jQuery.browser.msie || document.compatMode == "CSS1Compat",
	
	props: {
		"for": "htmlFor",
		"class": "className",
		"float": styleFloat,
		cssFloat: styleFloat,
		styleFloat: styleFloat,
		innerHTML: "innerHTML",
		className: "className",
		value: "value",
		disabled: "disabled",
		checked: "checked",
		readonly: "readOnly",
		selected: "selected",
		maxlength: "maxLength",
		selectedIndex: "selectedIndex",
		defaultValue: "defaultValue",
		tagName: "tagName",
		nodeName: "nodeName"
	}
});

jQuery.each({
	parent: function(elem){return elem.parentNode;},
	parents: function(elem){return jQuery.dir(elem,"parentNode");},
	next: function(elem){return jQuery.nth(elem,2,"nextSibling");},
	prev: function(elem){return jQuery.nth(elem,2,"previousSibling");},
	nextAll: function(elem){return jQuery.dir(elem,"nextSibling");},
	prevAll: function(elem){return jQuery.dir(elem,"previousSibling");},
	siblings: function(elem){return jQuery.sibling(elem.parentNode.firstChild,elem);},
	children: function(elem){return jQuery.sibling(elem.firstChild);},
	contents: function(elem){return jQuery.nodeName(elem,"iframe")?elem.contentDocument||elem.contentWindow.document:jQuery.makeArray(elem.childNodes);}
}, function(name, fn){
	jQuery.fn[ name ] = function( selector ) {
		var ret = jQuery.map( this, fn );

		if ( selector && typeof selector == "string" )
			ret = jQuery.multiFilter( selector, ret );

		return this.pushStack( jQuery.unique( ret ) );
	};
});

jQuery.each({
	appendTo: "append",
	prependTo: "prepend",
	insertBefore: "before",
	insertAfter: "after",
	replaceAll: "replaceWith"
}, function(name, original){
	jQuery.fn[ name ] = function() {
		var args = arguments;

		return this.each(function(){
			for ( var i = 0, length = args.length; i < length; i++ )
				jQuery( args[ i ] )[ original ]( this );
		});
	};
});

jQuery.each({
	removeAttr: function( name ) {
		jQuery.attr( this, name, "" );
		if (this.nodeType == 1) 
			this.removeAttribute( name );
	},

	addClass: function( classNames ) {
		jQuery.className.add( this, classNames );
	},

	removeClass: function( classNames ) {
		jQuery.className.remove( this, classNames );
	},

	toggleClass: function( classNames ) {
		jQuery.className[ jQuery.className.has( this, classNames ) ? "remove" : "add" ]( this, classNames );
	},

	remove: function( selector ) {
		if ( !selector || jQuery.filter( selector, [ this ] ).r.length ) {
			// Prevent memory leaks
			jQuery( "*", this ).add(this).each(function(){
				jQuery.event.remove(this);
				jQuery.removeData(this);
			});
			if (this.parentNode)
				this.parentNode.removeChild( this );
		}
	},

	empty: function() {
		// Remove element nodes and prevent memory leaks
		jQuery( ">*", this ).remove();
		
		// Remove any remaining nodes
		while ( this.firstChild )
			this.removeChild( this.firstChild );
	}
}, function(name, fn){
	jQuery.fn[ name ] = function(){
		return this.each( fn, arguments );
	};
});

jQuery.each([ "Height", "Width" ], function(i, name){
	var type = name.toLowerCase();
	
	jQuery.fn[ type ] = function( size ) {
		// Get window width or height
		return this[0] == window ?
			// Opera reports document.body.client[Width/Height] properly in both quirks and standards
			jQuery.browser.opera && document.body[ "client" + name ] || 
			
			// Safari reports inner[Width/Height] just fine (Mozilla and Opera include scroll bar widths)
			jQuery.browser.safari && window[ "inner" + name ] ||
			
			// Everyone else use document.documentElement or document.body depending on Quirks vs Standards mode
			document.compatMode == "CSS1Compat" && document.documentElement[ "client" + name ] || document.body[ "client" + name ] :
		
			// Get document width or height
			this[0] == document ?
				// Either scroll[Width/Height] or offset[Width/Height], whichever is greater
				Math.max( 
					Math.max(document.body["scroll" + name], document.documentElement["scroll" + name]), 
					Math.max(document.body["offset" + name], document.documentElement["offset" + name]) 
				) :

				// Get or set width or height on the element
				size == undefined ?
					// Get width or height on the element
					(this.length ? jQuery.css( this[0], type ) : null) :

					// Set the width or height on the element (default to pixels if value is unitless)
					this.css( type, size.constructor == String ? size : size + "px" );
	};
});

var chars = jQuery.browser.safari && parseInt(jQuery.browser.version) < 417 ?
		"(?:[\\w*_-]|\\\\.)" :
		"(?:[\\w\u0128-\uFFFF*_-]|\\\\.)",
	quickChild = new RegExp("^>\\s*(" + chars + "+)"),
	quickID = new RegExp("^(" + chars + "+)(#)(" + chars + "+)"),
	quickClass = new RegExp("^([#.]?)(" + chars + "*)");

jQuery.extend({
	expr: {
		"": function(a,i,m){return m[2]=="*"||jQuery.nodeName(a,m[2]);},
		"#": function(a,i,m){return a.getAttribute("id")==m[2];},
		":": {
			// Position Checks
			lt: function(a,i,m){return i<m[3]-0;},
			gt: function(a,i,m){return i>m[3]-0;},
			nth: function(a,i,m){return m[3]-0==i;},
			eq: function(a,i,m){return m[3]-0==i;},
			first: function(a,i){return i==0;},
			last: function(a,i,m,r){return i==r.length-1;},
			even: function(a,i){return i%2==0;},
			odd: function(a,i){return i%2;},

			// Child Checks
			"first-child": function(a){return a.parentNode.getElementsByTagName("*")[0]==a;},
			"last-child": function(a){return jQuery.nth(a.parentNode.lastChild,1,"previousSibling")==a;},
			"only-child": function(a){return !jQuery.nth(a.parentNode.lastChild,2,"previousSibling");},

			// Parent Checks
			parent: function(a){return a.firstChild;},
			empty: function(a){return !a.firstChild;},

			// Text Check
			contains: function(a,i,m){return (a.textContent||a.innerText||jQuery(a).text()||"").indexOf(m[3])>=0;},

			// Visibility
			visible: function(a){return "hidden"!=a.type&&jQuery.css(a,"display")!="none"&&jQuery.css(a,"visibility")!="hidden";},
			hidden: function(a){return "hidden"==a.type||jQuery.css(a,"display")=="none"||jQuery.css(a,"visibility")=="hidden";},

			// Form attributes
			enabled: function(a){return !a.disabled;},
			disabled: function(a){return a.disabled;},
			checked: function(a){return a.checked;},
			selected: function(a){return a.selected||jQuery.attr(a,"selected");},

			// Form elements
			text: function(a){return "text"==a.type;},
			radio: function(a){return "radio"==a.type;},
			checkbox: function(a){return "checkbox"==a.type;},
			file: function(a){return "file"==a.type;},
			password: function(a){return "password"==a.type;},
			submit: function(a){return "submit"==a.type;},
			image: function(a){return "image"==a.type;},
			reset: function(a){return "reset"==a.type;},
			button: function(a){return "button"==a.type||jQuery.nodeName(a,"button");},
			input: function(a){return /input|select|textarea|button/i.test(a.nodeName);},

			// :has()
			has: function(a,i,m){return jQuery.find(m[3],a).length;},

			// :header
			header: function(a){return /h\d/i.test(a.nodeName);},

			// :animated
			animated: function(a){return jQuery.grep(jQuery.timers,function(fn){return a==fn.elem;}).length;}
		}
	},
	
	// The regular expressions that power the parsing engine
	parse: [
		// Match: [@value='test'], [@foo]
		/^(\[) *@?([\w-]+) *([!*$^~=]*) *('?"?)(.*?)\4 *\]/,

		// Match: :contains('foo')
		/^(:)([\w-]+)\("?'?(.*?(\(.*?\))?[^(]*?)"?'?\)/,

		// Match: :even, :last-chlid, #id, .class
		new RegExp("^([:.#]*)(" + chars + "+)")
	],

	multiFilter: function( expr, elems, not ) {
		var old, cur = [];

		while ( expr && expr != old ) {
			old = expr;
			var f = jQuery.filter( expr, elems, not );
			expr = f.t.replace(/^\s*,\s*/, "" );
			cur = not ? elems = f.r : jQuery.merge( cur, f.r );
		}

		return cur;
	},

	find: function( t, context ) {
		// Quickly handle non-string expressions
		if ( typeof t != "string" )
			return [ t ];

		// check to make sure context is a DOM element or a document
		if ( context && context.nodeType != 1 && context.nodeType != 9)
			return [ ];

		// Set the correct context (if none is provided)
		context = context || document;

		// Initialize the search
		var ret = [context], done = [], last, nodeName;

		// Continue while a selector expression exists, and while
		// we're no longer looping upon ourselves
		while ( t && last != t ) {
			var r = [];
			last = t;

			t = jQuery.trim(t);

			var foundToken = false;

			// An attempt at speeding up child selectors that
			// point to a specific element tag
			var re = quickChild;
			var m = re.exec(t);

			if ( m ) {
				nodeName = m[1].toUpperCase();

				// Perform our own iteration and filter
				for ( var i = 0; ret[i]; i++ )
					for ( var c = ret[i].firstChild; c; c = c.nextSibling )
						if ( c.nodeType == 1 && (nodeName == "*" || c.nodeName.toUpperCase() == nodeName) )
							r.push( c );

				ret = r;
				t = t.replace( re, "" );
				if ( t.indexOf(" ") == 0 ) continue;
				foundToken = true;
			} else {
				re = /^([>+~])\s*(\w*)/i;

				if ( (m = re.exec(t)) != null ) {
					r = [];

					var merge = {};
					nodeName = m[2].toUpperCase();
					m = m[1];

					for ( var j = 0, rl = ret.length; j < rl; j++ ) {
						var n = m == "~" || m == "+" ? ret[j].nextSibling : ret[j].firstChild;
						for ( ; n; n = n.nextSibling )
							if ( n.nodeType == 1 ) {
								var id = jQuery.data(n);

								if ( m == "~" && merge[id] ) break;
								
								if (!nodeName || n.nodeName.toUpperCase() == nodeName ) {
									if ( m == "~" ) merge[id] = true;
									r.push( n );
								}
								
								if ( m == "+" ) break;
							}
					}

					ret = r;

					// And remove the token
					t = jQuery.trim( t.replace( re, "" ) );
					foundToken = true;
				}
			}

			// See if there's still an expression, and that we haven't already
			// matched a token
			if ( t && !foundToken ) {
				// Handle multiple expressions
				if ( !t.indexOf(",") ) {
					// Clean the result set
					if ( context == ret[0] ) ret.shift();

					// Merge the result sets
					done = jQuery.merge( done, ret );

					// Reset the context
					r = ret = [context];

					// Touch up the selector string
					t = " " + t.substr(1,t.length);

				} else {
					// Optimize for the case nodeName#idName
					var re2 = quickID;
					var m = re2.exec(t);
					
					// Re-organize the results, so that they're consistent
					if ( m ) {
						m = [ 0, m[2], m[3], m[1] ];

					} else {
						// Otherwise, do a traditional filter check for
						// ID, class, and element selectors
						re2 = quickClass;
						m = re2.exec(t);
					}

					m[2] = m[2].replace(/\\/g, "");

					var elem = ret[ret.length-1];

					// Try to do a global search by ID, where we can
					if ( m[1] == "#" && elem && elem.getElementById && !jQuery.isXMLDoc(elem) ) {
						// Optimization for HTML document case
						var oid = elem.getElementById(m[2]);
						
						// Do a quick check for the existence of the actual ID attribute
						// to avoid selecting by the name attribute in IE
						// also check to insure id is a string to avoid selecting an element with the name of 'id' inside a form
						if ( (jQuery.browser.msie||jQuery.browser.opera) && oid && typeof oid.id == "string" && oid.id != m[2] )
							oid = jQuery('[@id="'+m[2]+'"]', elem)[0];

						// Do a quick check for node name (where applicable) so
						// that div#foo searches will be really fast
						ret = r = oid && (!m[3] || jQuery.nodeName(oid, m[3])) ? [oid] : [];
					} else {
						// We need to find all descendant elements
						for ( var i = 0; ret[i]; i++ ) {
							// Grab the tag name being searched for
							var tag = m[1] == "#" && m[3] ? m[3] : m[1] != "" || m[0] == "" ? "*" : m[2];

							// Handle IE7 being really dumb about <object>s
							if ( tag == "*" && ret[i].nodeName.toLowerCase() == "object" )
								tag = "param";

							r = jQuery.merge( r, ret[i].getElementsByTagName( tag ));
						}

						// It's faster to filter by class and be done with it
						if ( m[1] == "." )
							r = jQuery.classFilter( r, m[2] );

						// Same with ID filtering
						if ( m[1] == "#" ) {
							var tmp = [];

							// Try to find the element with the ID
							for ( var i = 0; r[i]; i++ )
								if ( r[i].getAttribute("id") == m[2] ) {
									tmp = [ r[i] ];
									break;
								}

							r = tmp;
						}

						ret = r;
					}

					t = t.replace( re2, "" );
				}

			}

			// If a selector string still exists
			if ( t ) {
				// Attempt to filter it
				var val = jQuery.filter(t,r);
				ret = r = val.r;
				t = jQuery.trim(val.t);
			}
		}

		// An error occurred with the selector;
		// just return an empty set instead
		if ( t )
			ret = [];

		// Remove the root context
		if ( ret && context == ret[0] )
			ret.shift();

		// And combine the results
		done = jQuery.merge( done, ret );

		return done;
	},

	classFilter: function(r,m,not){
		m = " " + m + " ";
		var tmp = [];
		for ( var i = 0; r[i]; i++ ) {
			var pass = (" " + r[i].className + " ").indexOf( m ) >= 0;
			if ( !not && pass || not && !pass )
				tmp.push( r[i] );
		}
		return tmp;
	},

	filter: function(t,r,not) {
		var last;

		// Look for common filter expressions
		while ( t && t != last ) {
			last = t;

			var p = jQuery.parse, m;

			for ( var i = 0; p[i]; i++ ) {
				m = p[i].exec( t );

				if ( m ) {
					// Remove what we just matched
					t = t.substring( m[0].length );

					m[2] = m[2].replace(/\\/g, "");
					break;
				}
			}

			if ( !m )
				break;

			// :not() is a special case that can be optimized by
			// keeping it out of the expression list
			if ( m[1] == ":" && m[2] == "not" )
				// optimize if only one selector found (most common case)
				r = isSimple.test( m[3] ) ?
					jQuery.filter(m[3], r, true).r :
					jQuery( r ).not( m[3] );

			// We can get a big speed boost by filtering by class here
			else if ( m[1] == "." )
				r = jQuery.classFilter(r, m[2], not);

			else if ( m[1] == "[" ) {
				var tmp = [], type = m[3];
				
				for ( var i = 0, rl = r.length; i < rl; i++ ) {
					var a = r[i], z = a[ jQuery.props[m[2]] || m[2] ];
					
					if ( z == null || /href|src|selected/.test(m[2]) )
						z = jQuery.attr(a,m[2]) || '';

					if ( (type == "" && !!z ||
						 type == "=" && z == m[5] ||
						 type == "!=" && z != m[5] ||
						 type == "^=" && z && !z.indexOf(m[5]) ||
						 type == "$=" && z.substr(z.length - m[5].length) == m[5] ||
						 (type == "*=" || type == "~=") && z.indexOf(m[5]) >= 0) ^ not )
							tmp.push( a );
				}
				
				r = tmp;

			// We can get a speed boost by handling nth-child here
			} else if ( m[1] == ":" && m[2] == "nth-child" ) {
				var merge = {}, tmp = [],
					// parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6'
					test = /(-?)(\d*)n((?:\+|-)?\d*)/.exec(
						m[3] == "even" && "2n" || m[3] == "odd" && "2n+1" ||
						!/\D/.test(m[3]) && "0n+" + m[3] || m[3]),
					// calculate the numbers (first)n+(last) including if they are negative
					first = (test[1] + (test[2] || 1)) - 0, last = test[3] - 0;
 
				// loop through all the elements left in the jQuery object
				for ( var i = 0, rl = r.length; i < rl; i++ ) {
					var node = r[i], parentNode = node.parentNode, id = jQuery.data(parentNode);

					if ( !merge[id] ) {
						var c = 1;

						for ( var n = parentNode.firstChild; n; n = n.nextSibling )
							if ( n.nodeType == 1 )
								n.nodeIndex = c++;

						merge[id] = true;
					}

					var add = false;

					if ( first == 0 ) {
						if ( node.nodeIndex == last )
							add = true;
					} else if ( (node.nodeIndex - last) % first == 0 && (node.nodeIndex - last) / first >= 0 )
						add = true;

					if ( add ^ not )
						tmp.push( node );
				}

				r = tmp;

			// Otherwise, find the expression to execute
			} else {
				var fn = jQuery.expr[ m[1] ];
				if ( typeof fn == "object" )
					fn = fn[ m[2] ];

				if ( typeof fn == "string" )
					fn = eval("false||function(a,i){return " + fn + ";}");

				// Execute it against the current filter
				r = jQuery.grep( r, function(elem, i){
					return fn(elem, i, m, r);
				}, not );
			}
		}

		// Return an array of filtered elements (r)
		// and the modified expression string (t)
		return { r: r, t: t };
	},

	dir: function( elem, dir ){
		var matched = [];
		var cur = elem[dir];
		while ( cur && cur != document ) {
			if ( cur.nodeType == 1 )
				matched.push( cur );
			cur = cur[dir];
		}
		return matched;
	},
	
	nth: function(cur,result,dir,elem){
		result = result || 1;
		var num = 0;

		for ( ; cur; cur = cur[dir] )
			if ( cur.nodeType == 1 && ++num == result )
				break;

		return cur;
	},
	
	sibling: function( n, elem ) {
		var r = [];

		for ( ; n; n = n.nextSibling ) {
			if ( n.nodeType == 1 && (!elem || n != elem) )
				r.push( n );
		}

		return r;
	}
});

/*
 * A number of helper functions used for managing events.
 * Many of the ideas behind this code orignated from 
 * Dean Edwards' addEvent library.
 */
jQuery.event = {

	// Bind an event to an element
	// Original by Dean Edwards
	add: function(elem, types, handler, data) {
		if ( elem.nodeType == 3 || elem.nodeType == 8 )
			return;

		// For whatever reason, IE has trouble passing the window object
		// around, causing it to be cloned in the process
		if ( jQuery.browser.msie && elem.setInterval != undefined )
			elem = window;

		// Make sure that the function being executed has a unique ID
		if ( !handler.guid )
			handler.guid = this.guid++;
			
		// if data is passed, bind to handler 
		if( data != undefined ) { 
			// Create temporary function pointer to original handler 
			var fn = handler; 

			// Create unique handler function, wrapped around original handler 
			handler = function() { 
				// Pass arguments and context to original handler 
				return fn.apply(this, arguments); 
			};

			// Store data in unique handler 
			handler.data = data;

			// Set the guid of unique handler to the same of original handler, so it can be removed 
			handler.guid = fn.guid;
		}

		// Init the element's event structure
		var events = jQuery.data(elem, "events") || jQuery.data(elem, "events", {}),
			handle = jQuery.data(elem, "handle") || jQuery.data(elem, "handle", function(){
				// returned undefined or false
				var val;

				// Handle the second event of a trigger and when
				// an event is called after a page has unloaded
				if ( typeof jQuery == "undefined" || jQuery.event.triggered )
					return val;
		
				val = jQuery.event.handle.apply(arguments.callee.elem, arguments);
		
				return val;
			});
		// Add elem as a property of the handle function
		// This is to prevent a memory leak with non-native
		// event in IE.
		handle.elem = elem;
			
			// Handle multiple events seperated by a space
			// jQuery(...).bind("mouseover mouseout", fn);
			jQuery.each(types.split(/\s+/), function(index, type) {
				// Namespaced event handlers
				var parts = type.split(".");
				type = parts[0];
				handler.type = parts[1];

				// Get the current list of functions bound to this event
				var handlers = events[type];

				// Init the event handler queue
				if (!handlers) {
					handlers = events[type] = {};
		
					// Check for a special event handler
					// Only use addEventListener/attachEvent if the special
					// events handler returns false
					if ( !jQuery.event.special[type] || jQuery.event.special[type].setup.call(elem) === false ) {
						// Bind the global event handler to the element
						if (elem.addEventListener)
							elem.addEventListener(type, handle, false);
						else if (elem.attachEvent)
							elem.attachEvent("on" + type, handle);
					}
				}

				// Add the function to the element's handler list
				handlers[handler.guid] = handler;

				// Keep track of which events have been used, for global triggering
				jQuery.event.global[type] = true;
			});
		
		// Nullify elem to prevent memory leaks in IE
		elem = null;
	},

	guid: 1,
	global: {},

	// Detach an event or set of events from an element
	remove: function(elem, types, handler) {
		// don't do events on text and comment nodes
		if ( elem.nodeType == 3 || elem.nodeType == 8 )
			return;

		var events = jQuery.data(elem, "events"), ret, index;

		if ( events ) {
			// Unbind all events for the element
			if ( types == undefined || (typeof types == "string" && types.charAt(0) == ".") )
				for ( var type in events )
					this.remove( elem, type + (types || "") );
			else {
				// types is actually an event object here
				if ( types.type ) {
					handler = types.handler;
					types = types.type;
				}
				
				// Handle multiple events seperated by a space
				// jQuery(...).unbind("mouseover mouseout", fn);
				jQuery.each(types.split(/\s+/), function(index, type){
					// Namespaced event handlers
					var parts = type.split(".");
					type = parts[0];
					
					if ( events[type] ) {
						// remove the given handler for the given type
						if ( handler )
							delete events[type][handler.guid];
			
						// remove all handlers for the given type
						else
							for ( handler in events[type] )
								// Handle the removal of namespaced events
								if ( !parts[1] || events[type][handler].type == parts[1] )
									delete events[type][handler];

						// remove generic event handler if no more handlers exist
						for ( ret in events[type] ) break;
						if ( !ret ) {
							if ( !jQuery.event.special[type] || jQuery.event.special[type].teardown.call(elem) === false ) {
								if (elem.removeEventListener)
									elem.removeEventListener(type, jQuery.data(elem, "handle"), false);
								else if (elem.detachEvent)
									elem.detachEvent("on" + type, jQuery.data(elem, "handle"));
							}
							ret = null;
							delete events[type];
						}
					}
				});
			}

			// Remove the expando if it's no longer used
			for ( ret in events ) break;
			if ( !ret ) {
				var handle = jQuery.data( elem, "handle" );
				if ( handle ) handle.elem = null;
				jQuery.removeData( elem, "events" );
				jQuery.removeData( elem, "handle" );
			}
		}
	},

	trigger: function(type, data, elem, donative, extra) {
		// Clone the incoming data, if any
		data = jQuery.makeArray(data || []);

		if ( type.indexOf("!") >= 0 ) {
			type = type.slice(0, -1);
			var exclusive = true;
		}

		// Handle a global trigger
		if ( !elem ) {
			// Only trigger if we've ever bound an event for it
			if ( this.global[type] )
				jQuery("*").add([window, document]).trigger(type, data);

		// Handle triggering a single element
		} else {
			// don't do events on text and comment nodes
			if ( elem.nodeType == 3 || elem.nodeType == 8 )
				return undefined;

			var val, ret, fn = jQuery.isFunction( elem[ type ] || null ),
				// Check to see if we need to provide a fake event, or not
				event = !data[0] || !data[0].preventDefault;
			
			// Pass along a fake event
			if ( event )
				data.unshift( this.fix({ type: type, target: elem }) );

			// Enforce the right trigger type
			data[0].type = type;
			if ( exclusive )
				data[0].exclusive = true;

			// Trigger the event
			if ( jQuery.isFunction( jQuery.data(elem, "handle") ) )
				val = jQuery.data(elem, "handle").apply( elem, data );

			// Handle triggering native .onfoo handlers
			if ( !fn && elem["on"+type] && elem["on"+type].apply( elem, data ) === false )
				val = false;

			// Extra functions don't get the custom event object
			if ( event )
				data.shift();

			// Handle triggering of extra function
			if ( extra && jQuery.isFunction( extra ) ) {
				// call the extra function and tack the current return value on the end for possible inspection
				ret = extra.apply( elem, val == null ? data : data.concat( val ) );
				// if anything is returned, give it precedence and have it overwrite the previous value
				if (ret !== undefined)
					val = ret;
			}

			// Trigger the native events (except for clicks on links)
			if ( fn && donative !== false && val !== false && !(jQuery.nodeName(elem, 'a') && type == "click") ) {
				this.triggered = true;
				try {
					elem[ type ]();
				// prevent IE from throwing an error for some hidden elements
				} catch (e) {}
			}

			this.triggered = false;
		}

		return val;
	},

	handle: function(event) {
		// returned undefined or false
		var val;

		// Empty object is for triggered events with no data
		event = jQuery.event.fix( event || window.event || {} ); 

		// Namespaced event handlers
		var parts = event.type.split(".");
		event.type = parts[0];

		var handlers = jQuery.data(this, "events") && jQuery.data(this, "events")[event.type], args = Array.prototype.slice.call( arguments, 1 );
		args.unshift( event );

		for ( var j in handlers ) {
			var handler = handlers[j];
			// Pass in a reference to the handler function itself
			// So that we can later remove it
			args[0].handler = handler;
			args[0].data = handler.data;

			// Filter the functions by class
			if ( !parts[1] && !event.exclusive || handler.type == parts[1] ) {
				var ret = handler.apply( this, args );

				if ( val !== false )
					val = ret;

				if ( ret === false ) {
					event.preventDefault();
					event.stopPropagation();
				}
			}
		}

		// Clean up added properties in IE to prevent memory leak
		if (jQuery.browser.msie)
			event.target = event.preventDefault = event.stopPropagation =
				event.handler = event.data = null;

		return val;
	},

	fix: function(event) {
		// store a copy of the original event object 
		// and clone to set read-only properties
		var originalEvent = event;
		event = jQuery.extend({}, originalEvent);
		
		// add preventDefault and stopPropagation since 
		// they will not work on the clone
		event.preventDefault = function() {
			// if preventDefault exists run it on the original event
			if (originalEvent.preventDefault)
				originalEvent.preventDefault();
			// otherwise set the returnValue property of the original event to false (IE)
			originalEvent.returnValue = false;
		};
		event.stopPropagation = function() {
			// if stopPropagation exists run it on the original event
			if (originalEvent.stopPropagation)
				originalEvent.stopPropagation();
			// otherwise set the cancelBubble property of the original event to true (IE)
			originalEvent.cancelBubble = true;
		};
		
		// Fix target property, if necessary
		if ( !event.target )
			event.target = event.srcElement || document; // Fixes #1925 where srcElement might not be defined either
				
		// check if target is a textnode (safari)
		if ( event.target.nodeType == 3 )
			event.target = originalEvent.target.parentNode;

		// Add relatedTarget, if necessary
		if ( !event.relatedTarget && event.fromElement )
			event.relatedTarget = event.fromElement == event.target ? event.toElement : event.fromElement;

		// Calculate pageX/Y if missing and clientX/Y available
		if ( event.pageX == null && event.clientX != null ) {
			var doc = document.documentElement, body = document.body;
			event.pageX = event.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc.clientLeft || 0);
			event.pageY = event.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) - (doc.clientTop || 0);
		}
			
		// Add which for key events
		if ( !event.which && ((event.charCode || event.charCode === 0) ? event.charCode : event.keyCode) )
			event.which = event.charCode || event.keyCode;
		
		// Add metaKey to non-Mac browsers (use ctrl for PC's and Meta for Macs)
		if ( !event.metaKey && event.ctrlKey )
			event.metaKey = event.ctrlKey;

		// Add which for click: 1 == left; 2 == middle; 3 == right
		// Note: button is not normalized, so don't use it
		if ( !event.which && event.button )
			event.which = (event.button & 1 ? 1 : ( event.button & 2 ? 3 : ( event.button & 4 ? 2 : 0 ) ));
			
		return event;
	},
	
	special: {
		ready: {
			setup: function() {
				// Make sure the ready event is setup
				bindReady();
				return;
			},
			
			teardown: function() { return; }
		},
		
		mouseenter: {
			setup: function() {
				if ( jQuery.browser.msie ) return false;
				jQuery(this).bind("mouseover", jQuery.event.special.mouseenter.handler);
				return true;
			},
		
			teardown: function() {
				if ( jQuery.browser.msie ) return false;
				jQuery(this).unbind("mouseover", jQuery.event.special.mouseenter.handler);
				return true;
			},
			
			handler: function(event) {
				// If we actually just moused on to a sub-element, ignore it
				if ( withinElement(event, this) ) return true;
				// Execute the right handlers by setting the event type to mouseenter
				arguments[0].type = "mouseenter";
				return jQuery.event.handle.apply(this, arguments);
			}
		},
	
		mouseleave: {
			setup: function() {
				if ( jQuery.browser.msie ) return false;
				jQuery(this).bind("mouseout", jQuery.event.special.mouseleave.handler);
				return true;
			},
		
			teardown: function() {
				if ( jQuery.browser.msie ) return false;
				jQuery(this).unbind("mouseout", jQuery.event.special.mouseleave.handler);
				return true;
			},
			
			handler: function(event) {
				// If we actually just moused on to a sub-element, ignore it
				if ( withinElement(event, this) ) return true;
				// Execute the right handlers by setting the event type to mouseleave
				arguments[0].type = "mouseleave";
				return jQuery.event.handle.apply(this, arguments);
			}
		}
	}
};

jQuery.fn.extend({
	bind: function( type, data, fn ) {
		return type == "unload" ? this.one(type, data, fn) : this.each(function(){
			jQuery.event.add( this, type, fn || data, fn && data );
		});
	},
	
	one: function( type, data, fn ) {
		return this.each(function(){
			jQuery.event.add( this, type, function(event) {
				jQuery(this).unbind(event);
				return (fn || data).apply( this, arguments);
			}, fn && data);
		});
	},

	unbind: function( type, fn ) {
		return this.each(function(){
			jQuery.event.remove( this, type, fn );
		});
	},

	trigger: function( type, data, fn ) {
		return this.each(function(){
			jQuery.event.trigger( type, data, this, true, fn );
		});
	},

	triggerHandler: function( type, data, fn ) {
		if ( this[0] )
			return jQuery.event.trigger( type, data, this[0], false, fn );
		return undefined;
	},

	toggle: function() {
		// Save reference to arguments for access in closure
		var args = arguments;

		return this.click(function(event) {
			// Figure out which function to execute
			this.lastToggle = 0 == this.lastToggle ? 1 : 0;
			
			// Make sure that clicks stop
			event.preventDefault();
			
			// and execute the function
			return args[this.lastToggle].apply( this, arguments ) || false;
		});
	},

	hover: function(fnOver, fnOut) {
		return this.bind('mouseenter', fnOver).bind('mouseleave', fnOut);
	},
	
	ready: function(fn) {
		// Attach the listeners
		bindReady();

		// If the DOM is already ready
		if ( jQuery.isReady )
			// Execute the function immediately
			fn.call( document, jQuery );
			
		// Otherwise, remember the function for later
		else
			// Add the function to the wait list
			jQuery.readyList.push( function() { return fn.call(this, jQuery); } );
	
		return this;
	}
});

jQuery.extend({
	isReady: false,
	readyList: [],
	// Handle when the DOM is ready
	ready: function() {
		// Make sure that the DOM is not already loaded
		if ( !jQuery.isReady ) {
			// Remember that the DOM is ready
			jQuery.isReady = true;
			
			// If there are functions bound, to execute
			if ( jQuery.readyList ) {
				// Execute all of them
				jQuery.each( jQuery.readyList, function(){
					this.apply( document );
				});
				
				// Reset the list of functions
				jQuery.readyList = null;
			}
		
			// Trigger any bound ready events
			jQuery(document).triggerHandler("ready");
		}
	}
});

var readyBound = false;

function bindReady(){
	if ( readyBound ) return;
	readyBound = true;

	// Mozilla, Opera (see further below for it) and webkit nightlies currently support this event
	if ( document.addEventListener && !jQuery.browser.opera)
		// Use the handy event callback
		document.addEventListener( "DOMContentLoaded", jQuery.ready, false );
	
	// If IE is used and is not in a frame
	// Continually check to see if the document is ready
	if ( jQuery.browser.msie && window == top ) (function(){
		if (jQuery.isReady) return;
		try {
			// If IE is used, use the trick by Diego Perini
			// http://javascript.nwbox.com/IEContentLoaded/
			document.documentElement.doScroll("left");
		} catch( error ) {
			setTimeout( arguments.callee, 0 );
			return;
		}
		// and execute any waiting functions
		jQuery.ready();
	})();

	if ( jQuery.browser.opera )
		document.addEventListener( "DOMContentLoaded", function () {
			if (jQuery.isReady) return;
			for (var i = 0; i < document.styleSheets.length; i++)
				if (document.styleSheets[i].disabled) {
					setTimeout( arguments.callee, 0 );
					return;
				}
			// and execute any waiting functions
			jQuery.ready();
		}, false);

	if ( jQuery.browser.safari ) {
		var numStyles;
		(function(){
			if (jQuery.isReady) return;
			if ( document.readyState != "loaded" && document.readyState != "complete" ) {
				setTimeout( arguments.callee, 0 );
				return;
			}
			if ( numStyles === undefined )
				numStyles = jQuery("style, link[rel=stylesheet]").length;
			if ( document.styleSheets.length != numStyles ) {
				setTimeout( arguments.callee, 0 );
				return;
			}
			// and execute any waiting functions
			jQuery.ready();
		})();
	}

	// A fallback to window.onload, that will always work
	jQuery.event.add( window, "load", jQuery.ready );
}

jQuery.each( ("blur,focus,load,resize,scroll,unload,click,dblclick," +
	"mousedown,mouseup,mousemove,mouseover,mouseout,change,select," + 
	"submit,keydown,keypress,keyup,error").split(","), function(i, name){
	
	// Handle event binding
	jQuery.fn[name] = function(fn){
		return fn ? this.bind(name, fn) : this.trigger(name);
	};
});

// Checks if an event happened on an element within another element
// Used in jQuery.event.special.mouseenter and mouseleave handlers
var withinElement = function(event, elem) {
	// Check if mouse(over|out) are still within the same parent element
	var parent = event.relatedTarget;
	// Traverse up the tree
	while ( parent && parent != elem ) try { parent = parent.parentNode; } catch(error) { parent = elem; }
	// Return true if we actually just moused on to a sub-element
	return parent == elem;
};

// Prevent memory leaks in IE
// And prevent errors on refresh with events like mouseover in other browsers
// Window isn't included so as not to unbind existing unload events
jQuery(window).bind("unload", function() {
	jQuery("*").add(document).unbind();
});
jQuery.fn.extend({
	load: function( url, params, callback ) {
		if ( jQuery.isFunction( url ) )
			return this.bind("load", url);

		var off = url.indexOf(" ");
		if ( off >= 0 ) {
			var selector = url.slice(off, url.length);
			url = url.slice(0, off);
		}

		callback = callback || function(){};

		// Default to a GET request
		var type = "GET";

		// If the second parameter was provided
		if ( params )
			// If it's a function
			if ( jQuery.isFunction( params ) ) {
				// We assume that it's the callback
				callback = params;
				params = null;

			// Otherwise, build a param string
			} else {
				params = jQuery.param( params );
				type = "POST";
			}

		var self = this;

		// Request the remote document
		jQuery.ajax({
			url: url,
			type: type,
			dataType: "html",
			data: params,
			complete: function(res, status){
				// If successful, inject the HTML into all the matched elements
				if ( status == "success" || status == "notmodified" )
					// See if a selector was specified
					self.html( selector ?
						// Create a dummy div to hold the results
						jQuery("<div/>")
							// inject the contents of the document in, removing the scripts
							// to avoid any 'Permission Denied' errors in IE
							.append(res.responseText.replace(/<script(.|\s)*?\/script>/g, ""))

							// Locate the specified elements
							.find(selector) :

						// If not, just inject the full result
						res.responseText );

				self.each( callback, [res.responseText, status, res] );
			}
		});
		return this;
	},

	serialize: function() {
		return jQuery.param(this.serializeArray());
	},
	serializeArray: function() {
		return this.map(function(){
			return jQuery.nodeName(this, "form") ?
				jQuery.makeArray(this.elements) : this;
		})
		.filter(function(){
			return this.name && !this.disabled && 
				(this.checked || /select|textarea/i.test(this.nodeName) || 
					/text|hidden|password/i.test(this.type));
		})
		.map(function(i, elem){
			var val = jQuery(this).val();
			return val == null ? null :
				val.constructor == Array ?
					jQuery.map( val, function(val, i){
						return {name: elem.name, value: val};
					}) :
					{name: elem.name, value: val};
		}).get();
	}
});

// Attach a bunch of functions for handling common AJAX events
jQuery.each( "ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","), function(i,o){
	jQuery.fn[o] = function(f){
		return this.bind(o, f);
	};
});

var jsc = (new Date).getTime();

jQuery.extend({
	get: function( url, data, callback, type ) {
		// shift arguments if data argument was ommited
		if ( jQuery.isFunction( data ) ) {
			callback = data;
			data = null;
		}
		
		return jQuery.ajax({
			type: "GET",
			url: url,
			data: data,
			success: callback,
			dataType: type
		});
	},

	getScript: function( url, callback ) {
		return jQuery.get(url, null, callback, "script");
	},

	getJSON: function( url, data, callback ) {
		return jQuery.get(url, data, callback, "json");
	},

	post: function( url, data, callback, type ) {
		if ( jQuery.isFunction( data ) ) {
			callback = data;
			data = {};
		}

		return jQuery.ajax({
			type: "POST",
			url: url,
			data: data,
			success: callback,
			dataType: type
		});
	},

	ajaxSetup: function( settings ) {
		jQuery.extend( jQuery.ajaxSettings, settings );
	},

	ajaxSettings: {
		global: true,
		type: "GET",
		timeout: 0,
		contentType: "application/x-www-form-urlencoded",
		processData: true,
		async: true,
		data: null,
		username: null,
		password: null,
		accepts: {
			xml: "application/xml, text/xml",
			html: "text/html",
			script: "text/javascript, application/javascript",
			json: "application/json, text/javascript",
			text: "text/plain",
			_default: "*/*"
		}
	},
	
	// Last-Modified header cache for next request
	lastModified: {},

	ajax: function( s ) {
		var jsonp, jsre = /=\?(&|$)/g, status, data;

		// Extend the settings, but re-extend 's' so that it can be
		// checked again later (in the test suite, specifically)
		s = jQuery.extend(true, s, jQuery.extend(true, {}, jQuery.ajaxSettings, s));

		// convert data if not already a string
		if ( s.data && s.processData && typeof s.data != "string" )
			s.data = jQuery.param(s.data);

		// Handle JSONP Parameter Callbacks
		if ( s.dataType == "jsonp" ) {
			if ( s.type.toLowerCase() == "get" ) {
				if ( !s.url.match(jsre) )
					s.url += (s.url.match(/\?/) ? "&" : "?") + (s.jsonp || "callback") + "=?";
			} else if ( !s.data || !s.data.match(jsre) )
				s.data = (s.data ? s.data + "&" : "") + (s.jsonp || "callback") + "=?";
			s.dataType = "json";
		}

		// Build temporary JSONP function
		if ( s.dataType == "json" && (s.data && s.data.match(jsre) || s.url.match(jsre)) ) {
			jsonp = "jsonp" + jsc++;

			// Replace the =? sequence both in the query string and the data
			if ( s.data )
				s.data = (s.data + "").replace(jsre, "=" + jsonp + "$1");
			s.url = s.url.replace(jsre, "=" + jsonp + "$1");

			// We need to make sure
			// that a JSONP style response is executed properly
			s.dataType = "script";

			// Handle JSONP-style loading
			window[ jsonp ] = function(tmp){
				data = tmp;
				success();
				complete();
				// Garbage collect
				window[ jsonp ] = undefined;
				try{ delete window[ jsonp ]; } catch(e){}
				if ( head )
					head.removeChild( script );
			};
		}

		if ( s.dataType == "script" && s.cache == null )
			s.cache = false;

		if ( s.cache === false && s.type.toLowerCase() == "get" ) {
			var ts = (new Date()).getTime();
			// try replacing _= if it is there
			var ret = s.url.replace(/(\?|&)_=.*?(&|$)/, "$1_=" + ts + "$2");
			// if nothing was replaced, add timestamp to the end
			s.url = ret + ((ret == s.url) ? (s.url.match(/\?/) ? "&" : "?") + "_=" + ts : "");
		}

		// If data is available, append data to url for get requests
		if ( s.data && s.type.toLowerCase() == "get" ) {
			s.url += (s.url.match(/\?/) ? "&" : "?") + s.data;

			// IE likes to send both get and post data, prevent this
			s.data = null;
		}

		// Watch for a new set of requests
		if ( s.global && ! jQuery.active++ )
			jQuery.event.trigger( "ajaxStart" );

		// If we're requesting a remote document
		// and trying to load JSON or Script with a GET
		if ( (!s.url.indexOf("http") || !s.url.indexOf("//")) && s.dataType == "script" && s.type.toLowerCase() == "get" ) {
			var head = document.getElementsByTagName("head")[0];
			var script = document.createElement("script");
			script.src = s.url;
			if (s.scriptCharset)
				script.charset = s.scriptCharset;

			// Handle Script loading
			if ( !jsonp ) {
				var done = false;

				// Attach handlers for all browsers
				script.onload = script.onreadystatechange = function(){
					if ( !done && (!this.readyState || 
							this.readyState == "loaded" || this.readyState == "complete") ) {
						done = true;
						success();
						complete();
						head.removeChild( script );
					}
				};
			}

			head.appendChild(script);

			// We handle everything using the script element injection
			return undefined;
		}

		var requestDone = false;

		// Create the request object; Microsoft failed to properly
		// implement the XMLHttpRequest in IE7, so we use the ActiveXObject when it is available
		var xml = window.ActiveXObject ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest();

		// Open the socket
		xml.open(s.type, s.url, s.async, s.username, s.password);

		// Need an extra try/catch for cross domain requests in Firefox 3
		try {
			// Set the correct header, if data is being sent
			if ( s.data )
				xml.setRequestHeader("Content-Type", s.contentType);

			// Set the If-Modified-Since header, if ifModified mode.
			if ( s.ifModified )
				xml.setRequestHeader("If-Modified-Since",
					jQuery.lastModified[s.url] || "Thu, 01 Jan 1970 00:00:00 GMT" );

			// Set header so the called script knows that it's an XMLHttpRequest
			xml.setRequestHeader("X-Requested-With", "XMLHttpRequest");

			// Set the Accepts header for the server, depending on the dataType
			xml.setRequestHeader("Accept", s.dataType && s.accepts[ s.dataType ] ?
				s.accepts[ s.dataType ] + ", */*" :
				s.accepts._default );
		} catch(e){}

		// Allow custom headers/mimetypes
		if ( s.beforeSend )
			s.beforeSend(xml);
			
		if ( s.global )
			jQuery.event.trigger("ajaxSend", [xml, s]);

		// Wait for a response to come back
		var onreadystatechange = function(isTimeout){
			// The transfer is complete and the data is available, or the request timed out
			if ( !requestDone && xml && (xml.readyState == 4 || isTimeout == "timeout") ) {
				requestDone = true;
				
				// clear poll interval
				if (ival) {
					clearInterval(ival);
					ival = null;
				}
				
				status = isTimeout == "timeout" && "timeout" ||
					!jQuery.httpSuccess( xml ) && "error" ||
					s.ifModified && jQuery.httpNotModified( xml, s.url ) && "notmodified" ||
					"success";

				if ( status == "success" ) {
					// Watch for, and catch, XML document parse errors
					try {
						// process the data (runs the xml through httpData regardless of callback)
						data = jQuery.httpData( xml, s.dataType );
					} catch(e) {
						status = "parsererror";
					}
				}

				// Make sure that the request was successful or notmodified
				if ( status == "success" ) {
					// Cache Last-Modified header, if ifModified mode.
					var modRes;
					try {
						modRes = xml.getResponseHeader("Last-Modified");
					} catch(e) {} // swallow exception thrown by FF if header is not available
	
					if ( s.ifModified && modRes )
						jQuery.lastModified[s.url] = modRes;

					// JSONP handles its own success callback
					if ( !jsonp )
						success();	
				} else
					jQuery.handleError(s, xml, status);

				// Fire the complete handlers
				complete();

				// Stop memory leaks
				if ( s.async )
					xml = null;
			}
		};
		
		if ( s.async ) {
			// don't attach the handler to the request, just poll it instead
			var ival = setInterval(onreadystatechange, 13); 

			// Timeout checker
			if ( s.timeout > 0 )
				setTimeout(function(){
					// Check to see if the request is still happening
					if ( xml ) {
						// Cancel the request
						xml.abort();
	
						if( !requestDone )
							onreadystatechange( "timeout" );
					}
				}, s.timeout);
		}
			
		// Send the data
		try {
			xml.send(s.data);
		} catch(e) {
			jQuery.handleError(s, xml, null, e);
		}
		
		// firefox 1.5 doesn't fire statechange for sync requests
		if ( !s.async )
			onreadystatechange();

		function success(){
			// If a local callback was specified, fire it and pass it the data
			if ( s.success )
				s.success( data, status );

			// Fire the global callback
			if ( s.global )
				jQuery.event.trigger( "ajaxSuccess", [xml, s] );
		}

		function complete(){
			// Process result
			if ( s.complete )
				s.complete(xml, status);

			// The request was completed
			if ( s.global )
				jQuery.event.trigger( "ajaxComplete", [xml, s] );

			// Handle the global AJAX counter
			if ( s.global && ! --jQuery.active )
				jQuery.event.trigger( "ajaxStop" );
		}
		
		// return XMLHttpRequest to allow aborting the request etc.
		return xml;
	},

	handleError: function( s, xml, status, e ) {
		// If a local callback was specified, fire it
		if ( s.error ) s.error( xml, status, e );

		// Fire the global callback
		if ( s.global )
			jQuery.event.trigger( "ajaxError", [xml, s, e] );
	},

	// Counter for holding the number of active queries
	active: 0,

	// Determines if an XMLHttpRequest was successful or not
	httpSuccess: function( r ) {
		try {
			// IE error sometimes returns 1223 when it should be 204 so treat it as success, see #1450
			return !r.status && location.protocol == "file:" ||
				( r.status >= 200 && r.status < 300 ) || r.status == 304 || r.status == 1223 ||
				jQuery.browser.safari && r.status == undefined;
		} catch(e){}
		return false;
	},

	// Determines if an XMLHttpRequest returns NotModified
	httpNotModified: function( xml, url ) {
		try {
			var xmlRes = xml.getResponseHeader("Last-Modified");

			// Firefox always returns 200. check Last-Modified date
			return xml.status == 304 || xmlRes == jQuery.lastModified[url] ||
				jQuery.browser.safari && xml.status == undefined;
		} catch(e){}
		return false;
	},

	httpData: function( r, type ) {
		var ct = r.getResponseHeader("content-type");
		var xml = type == "xml" || !type && ct && ct.indexOf("xml") >= 0;
		var data = xml ? r.responseXML : r.responseText;

		if ( xml && data.documentElement.tagName == "parsererror" )
			throw "parsererror";

		// If the type is "script", eval it in global context
		if ( type == "script" )
			jQuery.globalEval( data );

		// Get the JavaScript object, if JSON is used.
		if ( type == "json" )
			data = eval("(" + data + ")");

		return data;
	},

	// Serialize an array of form elements or a set of
	// key/values into a query string
	param: function( a ) {
		var s = [];

		// If an array was passed in, assume that it is an array
		// of form elements
		if ( a.constructor == Array || a.jquery )
			// Serialize the form elements
			jQuery.each( a, function(){
				s.push( encodeURIComponent(this.name) + "=" + encodeURIComponent( this.value ) );
			});

		// Otherwise, assume that it's an object of key/value pairs
		else
			// Serialize the key/values
			for ( var j in a )
				// If the value is an array then the key names need to be repeated
				if ( a[j] && a[j].constructor == Array )
					jQuery.each( a[j], function(){
						s.push( encodeURIComponent(j) + "=" + encodeURIComponent( this ) );
					});
				else
					s.push( encodeURIComponent(j) + "=" + encodeURIComponent( a[j] ) );

		// Return the resulting serialization
		return s.join("&").replace(/%20/g, "+");
	}

});
jQuery.fn.extend({
	show: function(speed,callback){
		return speed ?
			this.animate({
				height: "show", width: "show", opacity: "show"
			}, speed, callback) :
			
			this.filter(":hidden").each(function(){
				this.style.display = this.oldblock || "";
				if ( jQuery.css(this,"display") == "none" ) {
					var elem = jQuery("<" + this.tagName + " />").appendTo("body");
					this.style.display = elem.css("display");
					// handle an edge condition where css is - div { display:none; } or similar
					if (this.style.display == "none")
						this.style.display = "block";
					elem.remove();
				}
			}).end();
	},
	
	hide: function(speed,callback){
		return speed ?
			this.animate({
				height: "hide", width: "hide", opacity: "hide"
			}, speed, callback) :
			
			this.filter(":visible").each(function(){
				this.oldblock = this.oldblock || jQuery.css(this,"display");
				this.style.display = "none";
			}).end();
	},

	// Save the old toggle function
	_toggle: jQuery.fn.toggle,
	
	toggle: function( fn, fn2 ){
		return jQuery.isFunction(fn) && jQuery.isFunction(fn2) ?
			this._toggle( fn, fn2 ) :
			fn ?
				this.animate({
					height: "toggle", width: "toggle", opacity: "toggle"
				}, fn, fn2) :
				this.each(function(){
					jQuery(this)[ jQuery(this).is(":hidden") ? "show" : "hide" ]();
				});
	},
	
	slideDown: function(speed,callback){
		return this.animate({height: "show"}, speed, callback);
	},
	
	slideUp: function(speed,callback){
		return this.animate({height: "hide"}, speed, callback);
	},

	slideToggle: function(speed, callback){
		return this.animate({height: "toggle"}, speed, callback);
	},
	
	fadeIn: function(speed, callback){
		return this.animate({opacity: "show"}, speed, callback);
	},
	
	fadeOut: function(speed, callback){
		return this.animate({opacity: "hide"}, speed, callback);
	},
	
	fadeTo: function(speed,to,callback){
		return this.animate({opacity: to}, speed, callback);
	},
	
	animate: function( prop, speed, easing, callback ) {
		var optall = jQuery.speed(speed, easing, callback);

		return this[ optall.queue === false ? "each" : "queue" ](function(){
			if ( this.nodeType != 1)
				return false;

			var opt = jQuery.extend({}, optall);
			var hidden = jQuery(this).is(":hidden"), self = this;
			
			for ( var p in prop ) {
				if ( prop[p] == "hide" && hidden || prop[p] == "show" && !hidden )
					return jQuery.isFunction(opt.complete) && opt.complete.apply(this);

				if ( p == "height" || p == "width" ) {
					// Store display property
					opt.display = jQuery.css(this, "display");

					// Make sure that nothing sneaks out
					opt.overflow = this.style.overflow;
				}
			}

			if ( opt.overflow != null )
				this.style.overflow = "hidden";

			opt.curAnim = jQuery.extend({}, prop);
			
			jQuery.each( prop, function(name, val){
				var e = new jQuery.fx( self, opt, name );

				if ( /toggle|show|hide/.test(val) )
					e[ val == "toggle" ? hidden ? "show" : "hide" : val ]( prop );
				else {
					var parts = val.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),
						start = e.cur(true) || 0;

					if ( parts ) {
						var end = parseFloat(parts[2]),
							unit = parts[3] || "px";

						// We need to compute starting value
						if ( unit != "px" ) {
							self.style[ name ] = (end || 1) + unit;
							start = ((end || 1) / e.cur(true)) * start;
							self.style[ name ] = start + unit;
						}

						// If a +=/-= token was provided, we're doing a relative animation
						if ( parts[1] )
							end = ((parts[1] == "-=" ? -1 : 1) * end) + start;

						e.custom( start, end, unit );
					} else
						e.custom( start, val, "" );
				}
			});

			// For JS strict compliance
			return true;
		});
	},
	
	queue: function(type, fn){
		if ( jQuery.isFunction(type) || ( type && type.constructor == Array )) {
			fn = type;
			type = "fx";
		}

		if ( !type || (typeof type == "string" && !fn) )
			return queue( this[0], type );

		return this.each(function(){
			if ( fn.constructor == Array )
				queue(this, type, fn);
			else {
				queue(this, type).push( fn );
			
				if ( queue(this, type).length == 1 )
					fn.apply(this);
			}
		});
	},

	stop: function(clearQueue, gotoEnd){
		var timers = jQuery.timers;

		if (clearQueue)
			this.queue([]);

		this.each(function(){
			// go in reverse order so anything added to the queue during the loop is ignored
			for ( var i = timers.length - 1; i >= 0; i-- )
				if ( timers[i].elem == this ) {
					if (gotoEnd)
						// force the next step to be the last
						timers[i](true);
					timers.splice(i, 1);
				}
		});

		// start the next in the queue if the last step wasn't forced
		if (!gotoEnd)
			this.dequeue();

		return this;
	}

});

var queue = function( elem, type, array ) {
	if ( !elem )
		return undefined;

	type = type || "fx";

	var q = jQuery.data( elem, type + "queue" );

	if ( !q || array )
		q = jQuery.data( elem, type + "queue", 
			array ? jQuery.makeArray(array) : [] );

	return q;
};

jQuery.fn.dequeue = function(type){
	type = type || "fx";

	return this.each(function(){
		var q = queue(this, type);

		q.shift();

		if ( q.length )
			q[0].apply( this );
	});
};

jQuery.extend({
	
	speed: function(speed, easing, fn) {
		var opt = speed && speed.constructor == Object ? speed : {
			complete: fn || !fn && easing || 
				jQuery.isFunction( speed ) && speed,
			duration: speed,
			easing: fn && easing || easing && easing.constructor != Function && easing
		};

		opt.duration = (opt.duration && opt.duration.constructor == Number ? 
			opt.duration : 
			{ slow: 600, fast: 200 }[opt.duration]) || 400;
	
		// Queueing
		opt.old = opt.complete;
		opt.complete = function(){
			if ( opt.queue !== false )
				jQuery(this).dequeue();
			if ( jQuery.isFunction( opt.old ) )
				opt.old.apply( this );
		};
	
		return opt;
	},
	
	easing: {
		linear: function( p, n, firstNum, diff ) {
			return firstNum + diff * p;
		},
		swing: function( p, n, firstNum, diff ) {
			return ((-Math.cos(p*Math.PI)/2) + 0.5) * diff + firstNum;
		}
	},
	
	timers: [],
	timerId: null,

	fx: function( elem, options, prop ){
		this.options = options;
		this.elem = elem;
		this.prop = prop;

		if ( !options.orig )
			options.orig = {};
	}

});

jQuery.fx.prototype = {

	// Simple function for setting a style value
	update: function(){
		if ( this.options.step )
			this.options.step.apply( this.elem, [ this.now, this ] );

		(jQuery.fx.step[this.prop] || jQuery.fx.step._default)( this );

		// Set display property to block for height/width animations
		if ( this.prop == "height" || this.prop == "width" )
			this.elem.style.display = "block";
	},

	// Get the current size
	cur: function(force){
		if ( this.elem[this.prop] != null && this.elem.style[this.prop] == null )
			return this.elem[ this.prop ];

		var r = parseFloat(jQuery.css(this.elem, this.prop, force));
		return r && r > -10000 ? r : parseFloat(jQuery.curCSS(this.elem, this.prop)) || 0;
	},

	// Start an animation from one number to another
	custom: function(from, to, unit){
		this.startTime = (new Date()).getTime();
		this.start = from;
		this.end = to;
		this.unit = unit || this.unit || "px";
		this.now = this.start;
		this.pos = this.state = 0;
		this.update();

		var self = this;
		function t(gotoEnd){
			return self.step(gotoEnd);
		}

		t.elem = this.elem;

		jQuery.timers.push(t);

		if ( jQuery.timerId == null ) {
			jQuery.timerId = setInterval(function(){
				var timers = jQuery.timers;
				
				for ( var i = 0; i < timers.length; i++ )
					if ( !timers[i]() )
						timers.splice(i--, 1);

				if ( !timers.length ) {
					clearInterval( jQuery.timerId );
					jQuery.timerId = null;
				}
			}, 13);
		}
	},

	// Simple 'show' function
	show: function(){
		// Remember where we started, so that we can go back to it later
		this.options.orig[this.prop] = jQuery.attr( this.elem.style, this.prop );
		this.options.show = true;

		// Begin the animation
		this.custom(0, this.cur());

		// Make sure that we start at a small width/height to avoid any
		// flash of content
		if ( this.prop == "width" || this.prop == "height" )
			this.elem.style[this.prop] = "1px";
		
		// Start by showing the element
		jQuery(this.elem).show();
	},

	// Simple 'hide' function
	hide: function(){
		// Remember where we started, so that we can go back to it later
		this.options.orig[this.prop] = jQuery.attr( this.elem.style, this.prop );
		this.options.hide = true;

		// Begin the animation
		this.custom(this.cur(), 0);
	},

	// Each step of an animation
	step: function(gotoEnd){
		var t = (new Date()).getTime();

		if ( gotoEnd || t > this.options.duration + this.startTime ) {
			this.now = this.end;
			this.pos = this.state = 1;
			this.update();

			this.options.curAnim[ this.prop ] = true;

			var done = true;
			for ( var i in this.options.curAnim )
				if ( this.options.curAnim[i] !== true )
					done = false;

			if ( done ) {
				if ( this.options.display != null ) {
					// Reset the overflow
					this.elem.style.overflow = this.options.overflow;
				
					// Reset the display
					this.elem.style.display = this.options.display;
					if ( jQuery.css(this.elem, "display") == "none" )
						this.elem.style.display = "block";
				}

				// Hide the element if the "hide" operation was done
				if ( this.options.hide )
					this.elem.style.display = "none";

				// Reset the properties, if the item has been hidden or shown
				if ( this.options.hide || this.options.show )
					for ( var p in this.options.curAnim )
						jQuery.attr(this.elem.style, p, this.options.orig[p]);
			}

			// If a callback was provided, execute it
			if ( done && jQuery.isFunction( this.options.complete ) )
				// Execute the complete function
				this.options.complete.apply( this.elem );

			return false;
		} else {
			var n = t - this.startTime;
			this.state = n / this.options.duration;

			// Perform the easing function, defaults to swing
			this.pos = jQuery.easing[this.options.easing || (jQuery.easing.swing ? "swing" : "linear")](this.state, n, 0, 1, this.options.duration);
			this.now = this.start + ((this.end - this.start) * this.pos);

			// Perform the next step of the animation
			this.update();
		}

		return true;
	}

};

jQuery.fx.step = {
	scrollLeft: function(fx){
		fx.elem.scrollLeft = fx.now;
	},

	scrollTop: function(fx){
		fx.elem.scrollTop = fx.now;
	},

	opacity: function(fx){
		jQuery.attr(fx.elem.style, "opacity", fx.now);
	},

	_default: function(fx){
		fx.elem.style[ fx.prop ] = fx.now + fx.unit;
	}
};
// The Offset Method
// Originally By Brandon Aaron, part of the Dimension Plugin
// http://jquery.com/plugins/project/dimensions
jQuery.fn.offset = function() {
	var left = 0, top = 0, elem = this[0], results;
	
	if ( elem ) with ( jQuery.browser ) {
		var parent       = elem.parentNode, 
		    offsetChild  = elem,
		    offsetParent = elem.offsetParent, 
		    doc          = elem.ownerDocument,
		    safari2      = safari && parseInt(version) < 522 && !/adobeair/i.test(userAgent),
		    fixed        = jQuery.css(elem, "position") == "fixed";
	
		// Use getBoundingClientRect if available
		if ( elem.getBoundingClientRect ) {
			var box = elem.getBoundingClientRect();
		
			// Add the document scroll offsets
			add(box.left + Math.max(doc.documentElement.scrollLeft, doc.body.scrollLeft),
				box.top  + Math.max(doc.documentElement.scrollTop,  doc.body.scrollTop));
		
			// IE adds the HTML element's border, by default it is medium which is 2px
			// IE 6 and 7 quirks mode the border width is overwritable by the following css html { border: 0; }
			// IE 7 standards mode, the border is always 2px
			// This border/offset is typically represented by the clientLeft and clientTop properties
			// However, in IE6 and 7 quirks mode the clientLeft and clientTop properties are not updated when overwriting it via CSS
			// Therefore this method will be off by 2px in IE while in quirksmode
			add( -doc.documentElement.clientLeft, -doc.documentElement.clientTop );
	
		// Otherwise loop through the offsetParents and parentNodes
		} else {
		
			// Initial element offsets
			add( elem.offsetLeft, elem.offsetTop );
			
			// Get parent offsets
			while ( offsetParent ) {
				// Add offsetParent offsets
				add( offsetParent.offsetLeft, offsetParent.offsetTop );
			
				// Mozilla and Safari > 2 does not include the border on offset parents
				// However Mozilla adds the border for table or table cells
				if ( mozilla && !/^t(able|d|h)$/i.test(offsetParent.tagName) || safari && !safari2 )
					border( offsetParent );
					
				// Add the document scroll offsets if position is fixed on any offsetParent
				if ( !fixed && jQuery.css(offsetParent, "position") == "fixed" )
					fixed = true;
			
				// Set offsetChild to previous offsetParent unless it is the body element
				offsetChild  = /^body$/i.test(offsetParent.tagName) ? offsetChild : offsetParent;
				// Get next offsetParent
				offsetParent = offsetParent.offsetParent;
			}
		
			// Get parent scroll offsets
			while ( parent && parent.tagName && !/^body|html$/i.test(parent.tagName) ) {
				// Remove parent scroll UNLESS that parent is inline or a table to work around Opera inline/table scrollLeft/Top bug
				if ( !/^inline|table.*$/i.test(jQuery.css(parent, "display")) )
					// Subtract parent scroll offsets
					add( -parent.scrollLeft, -parent.scrollTop );
			
				// Mozilla does not add the border for a parent that has overflow != visible
				if ( mozilla && jQuery.css(parent, "overflow") != "visible" )
					border( parent );
			
				// Get next parent
				parent = parent.parentNode;
			}
		
			// Safari <= 2 doubles body offsets with a fixed position element/offsetParent or absolutely positioned offsetChild
			// Mozilla doubles body offsets with a non-absolutely positioned offsetChild
			if ( (safari2 && (fixed || jQuery.css(offsetChild, "position") == "absolute")) || 
				(mozilla && jQuery.css(offsetChild, "position") != "absolute") )
					add( -doc.body.offsetLeft, -doc.body.offsetTop );
			
			// Add the document scroll offsets if position is fixed
			if ( fixed )
				add(Math.max(doc.documentElement.scrollLeft, doc.body.scrollLeft),
					Math.max(doc.documentElement.scrollTop,  doc.body.scrollTop));
		}

		// Return an object with top and left properties
		results = { top: top, left: left };
	}

	function border(elem) {
		add( jQuery.curCSS(elem, "borderLeftWidth", true), jQuery.curCSS(elem, "borderTopWidth", true) );
	}

	function add(l, t) {
		left += parseInt(l) || 0;
		top += parseInt(t) || 0;
	}

	return results;
};
})();
//\/////
//\  overLIB 4.21 - You may not remove or change this notice.
//\  Copyright Erik Bosrup 1998-2004. All rights reserved.
//\
//\  Contributors are listed on the homepage.
//\  This file might be old, always check for the latest version at:
//\  http://www.bosrup.com/web/overlib/
//\
//\  Please read the license agreement (available through the link above)
//\  before using overLIB. Direct any licensing questions to erik@bosrup.com.
//\
//\  Do not sell this as your own work or remove this copyright notice. 
//\  For full details on copying or changing this script please read the
//\  license agreement at the link above. Please give credit on sites that
//\  use overLIB and submit changes of the script so other people can use
//\  them as well.
//   $Revision: 1.2 $                $Date: 2009/08/05 17:57:08 $
//\/////
//\mini

////////
// PRE-INIT
// Ignore these lines, configuration is below.
////////
var olLoaded = 0;var pmStart = 10000000; var pmUpper = 10001000; var pmCount = pmStart+1; var pmt=''; var pms = new Array(); var olInfo = new Info('4.21', 1);
var FREPLACE = 0; var FBEFORE = 1; var FAFTER = 2; var FALTERNATE = 3; var FCHAIN=4;
var olHideForm=0;  // parameter for hiding SELECT and ActiveX elements in IE5.5+ 
var olHautoFlag = 0;  // flags for over-riding VAUTO and HAUTO if corresponding
var olVautoFlag = 0;  // positioning commands are used on the command line
var hookPts = new Array(), postParse = new Array(), cmdLine = new Array(), runTime = new Array();
// for plugins
registerCommands('donothing,inarray,caparray,sticky,background,noclose,caption,left,right,center,offsetx,offsety,fgcolor,bgcolor,textcolor,capcolor,closecolor,width,border,cellpad,status,autostatus,autostatuscap,height,closetext,snapx,snapy,fixx,fixy,relx,rely,fgbackground,bgbackground,padx,pady,fullhtml,above,below,capicon,textfont,captionfont,closefont,textsize,captionsize,closesize,timeout,function,delay,hauto,vauto,closeclick,wrap,followmouse,mouseoff,closetitle,cssoff,compatmode,cssclass,fgclass,bgclass,textfontclass,captionfontclass,closefontclass');

////////
// DEFAULT CONFIGURATION
// Settings you want everywhere are set here. All of this can also be
// changed on your html page or through an overLIB call.
////////
if (typeof ol_fgcolor=='undefined') var ol_fgcolor="#ffffff";
if (typeof ol_bgcolor=='undefined') var ol_bgcolor="#cccccc";//#555555";//"#fcd32f";
if (typeof ol_textcolor=='undefined') var ol_textcolor="#000000";
if (typeof ol_capcolor=='undefined') var ol_capcolor="#106385";
if (typeof ol_closecolor=='undefined') var ol_closecolor="#666666";
if (typeof ol_textfont=='undefined') var ol_textfont="Verdana,Arial,Helvetica";
if (typeof ol_captionfont=='undefined') var ol_captionfont="Verdana,Arial,Helvetica";
if (typeof ol_closefont=='undefined') var ol_closefont="Verdana,Arial,Helvetica";
if (typeof ol_textsize=='undefined') var ol_textsize="1";
if (typeof ol_captionsize=='undefined') var ol_captionsize="11.5px";
if (typeof ol_closesize=='undefined') var ol_closesize="1";
if (typeof ol_width=='undefined') var ol_width="223";
if (typeof ol_border=='undefined') var ol_border="1";
if (typeof ol_cellpad=='undefined') var ol_cellpad=2;
if (typeof ol_offsetx=='undefined') var ol_offsetx=10;
if (typeof ol_offsety=='undefined') var ol_offsety=10;
if (typeof ol_text=='undefined') var ol_text="Default Text";
if (typeof ol_cap=='undefined') var ol_cap="";
if (typeof ol_sticky=='undefined') var ol_sticky=0;
if (typeof ol_background=='undefined') var ol_background="";
if (typeof ol_close=='undefined') var ol_close="Close";
if (typeof ol_hpos=='undefined') var ol_hpos=RIGHT;
if (typeof ol_status=='undefined') var ol_status="";
if (typeof ol_autostatus=='undefined') var ol_autostatus=0;
if (typeof ol_height=='undefined') var ol_height=-1;
if (typeof ol_snapx=='undefined') var ol_snapx=0;
if (typeof ol_snapy=='undefined') var ol_snapy=0;
if (typeof ol_fixx=='undefined') var ol_fixx=-1;
if (typeof ol_fixy=='undefined') var ol_fixy=-1;
if (typeof ol_relx=='undefined') var ol_relx=null;
if (typeof ol_rely=='undefined') var ol_rely=null;
if (typeof ol_fgbackground=='undefined') var ol_fgbackground="";
if (typeof ol_bgbackground=='undefined') var ol_bgbackground="../../..//images/single_ext/r.jpg";
if (typeof ol_padxl=='undefined') var ol_padxl=1;
if (typeof ol_padxr=='undefined') var ol_padxr=1;
if (typeof ol_padyt=='undefined') var ol_padyt=1;
if (typeof ol_padyb=='undefined') var ol_padyb=1;
if (typeof ol_fullhtml=='undefined') var ol_fullhtml=0;
if (typeof ol_vpos=='undefined') var ol_vpos=BELOW;
if (typeof ol_aboveheight=='undefined') var ol_aboveheight=0;
if (typeof ol_capicon=='undefined') var ol_capicon="";
if (typeof ol_frame=='undefined') var ol_frame=self;
if (typeof ol_timeout=='undefined') var ol_timeout=0;
if (typeof ol_function=='undefined') var ol_function=null;
if (typeof ol_delay=='undefined') var ol_delay=0;
if (typeof ol_hauto=='undefined') var ol_hauto=0;
if (typeof ol_vauto=='undefined') var ol_vauto=0;
if (typeof ol_closeclick=='undefined') var ol_closeclick=0;
if (typeof ol_wrap=='undefined') var ol_wrap=0;
if (typeof ol_followmouse=='undefined') var ol_followmouse=1;
if (typeof ol_mouseoff=='undefined') var ol_mouseoff=0;
if (typeof ol_closetitle=='undefined') var ol_closetitle='Close';
if (typeof ol_compatmode=='undefined') var ol_compatmode=0;
if (typeof ol_css=='undefined') var ol_css=CSSOFF;
if (typeof ol_fgclass=='undefined') var ol_fgclass="";
if (typeof ol_bgclass=='undefined') var ol_bgclass="";
if (typeof ol_textfontclass=='undefined') var ol_textfontclass="";
if (typeof ol_captionfontclass=='undefined') var ol_captionfontclass="";
if (typeof ol_closefontclass=='undefined') var ol_closefontclass="";

////////
// ARRAY CONFIGURATION
////////

// You can use these arrays to store popup text here instead of in the html.
if (typeof ol_texts=='undefined') var ol_texts = new Array("Text 0", "Text 1");
if (typeof ol_caps=='undefined') var ol_caps = new Array("Caption 0", "Caption 1");

////////
// END OF CONFIGURATION
// Don't change anything below this line, all configuration is above.
////////





////////
// INIT
////////
// Runtime variables init. Don't change for config!
var o3_text="";
var o3_cap="";
var o3_sticky=0;
var o3_background="";
var o3_close="Close";
var o3_hpos=RIGHT;
var o3_offsetx=2;
var o3_offsety=2;
var o3_fgcolor="";
var o3_bgcolor="";
var o3_textcolor="";
var o3_capcolor="";
var o3_closecolor="";
var o3_width=100;
var o3_border=1;
var o3_cellpad=2;
var o3_status="";
var o3_autostatus=0;
var o3_height=-1;
var o3_snapx=0;
var o3_snapy=0;
var o3_fixx=-1;
var o3_fixy=-1;
var o3_relx=null;
var o3_rely=null;
var o3_fgbackground="";
var o3_bgbackground="";
var o3_padxl=0;
var o3_padxr=0;
var o3_padyt=0;
var o3_padyb=0;
var o3_fullhtml=0;
var o3_vpos=BELOW;
var o3_aboveheight=0;
var o3_capicon="";
var o3_textfont="Verdana,Arial,Helvetica";
var o3_captionfont="Verdana,Arial,Helvetica";
var o3_closefont="Verdana,Arial,Helvetica";
var o3_textsize="1";
var o3_captionsize="1";
var o3_closesize="1";
var o3_frame=self;
var o3_timeout=0;
var o3_timerid=0;
var o3_allowmove=0;
var o3_function=null; 
var o3_delay=0;
var o3_delayid=0;
var o3_hauto=0;
var o3_vauto=0;
var o3_closeclick=0;
var o3_wrap=0;
var o3_followmouse=1;
var o3_mouseoff=0;
var o3_closetitle='';
var o3_compatmode=0;
var o3_css=CSSOFF;
var o3_fgclass="";
var o3_bgclass="";
var o3_textfontclass="";
var o3_captionfontclass="";
var o3_closefontclass="";

// Display state variables
var o3_x = 0;
var o3_y = 0;
var o3_showingsticky = 0;
var o3_removecounter = 0;

// Our layer
var over = null;
var fnRef, hoveringSwitch = false;
var olHideDelay;

// Decide browser version
var isMac = (navigator.userAgent.indexOf("Mac") != -1);
var olOp = (navigator.userAgent.toLowerCase().indexOf('opera') > -1 && document.createTextNode);  // Opera 7
var olNs4 = (navigator.appName=='Netscape' && parseInt(navigator.appVersion) == 4);
var olNs6 = (document.getElementById) ? true : false;
var olKq = (olNs6 && /konqueror/i.test(navigator.userAgent));
var olIe4 = (document.all) ? true : false;
var olIe5 = false; 
var olIe55 = false; // Added additional variable to identify IE5.5+
var docRoot = 'document.body';

// Resize fix for NS4.x to keep track of layer
if (olNs4) {
	var oW = window.innerWidth;
	var oH = window.innerHeight;
	window.onresize = function() { if (oW != window.innerWidth || oH != window.innerHeight) location.reload(); }
}

// Microsoft Stupidity Check(tm).
if (olIe4) {
	var agent = navigator.userAgent;
	if (/MSIE/.test(agent)) {
		var versNum = parseFloat(agent.match(/MSIE[ ](\d\.\d+)\.*/i)[1]);
		if (versNum >= 5){
			olIe5=true;
			olIe55=(versNum>=5.5&&!olOp) ? true : false;
			if (olNs6) olNs6=false;
		}
	}
	if (olNs6) olIe4 = false;
}

// Check for compatability mode.
if (document.compatMode && document.compatMode == 'CSS1Compat') {
	docRoot= ((olIe4 && !olOp) ? 'document.documentElement' : docRoot);
}

// Add window onload handlers to indicate when all modules have been loaded
// For Netscape 6+ and Mozilla, uses addEventListener method on the window object
// For IE it uses the attachEvent method of the window object and for Netscape 4.x
// it sets the window.onload handler to the OLonload_handler function for Bubbling
if(window.addEventListener) window.addEventListener("load",OLonLoad_handler,false);
else if (window.attachEvent) window.attachEvent("onload",OLonLoad_handler);

var capExtent;

////////
// PUBLIC FUNCTIONS
////////

// overlib(arg0,...,argN)
// Loads parameters into global runtime variables.
function overlib() {
	if (!olLoaded || isExclusive(overlib.arguments)) return true;
	if (olCheckMouseCapture) olMouseCapture();
	if (over) {
		over = (typeof over.id != 'string') ? o3_frame.document.all['overDiv'] : over;
		cClick();
	}

	// Load defaults to runtime.
  olHideDelay=0;
	o3_text=ol_text;
	o3_cap=ol_cap;
	o3_sticky=ol_sticky;
	o3_background=ol_background;
	o3_close=ol_close;
	o3_hpos=ol_hpos;
	o3_offsetx=ol_offsetx;
	o3_offsety=ol_offsety;
	o3_fgcolor=ol_fgcolor;
	o3_bgcolor=ol_bgcolor;
	o3_textcolor=ol_textcolor;
	o3_capcolor=ol_capcolor;
	o3_closecolor=ol_closecolor;
	o3_width=ol_width;
	o3_border=ol_border;
	o3_cellpad=ol_cellpad;
	o3_status=ol_status;
	o3_autostatus=ol_autostatus;
	o3_height=ol_height;
	o3_snapx=ol_snapx;
	o3_snapy=ol_snapy;
	o3_fixx=ol_fixx;
	o3_fixy=ol_fixy;
	o3_relx=ol_relx;
	o3_rely=ol_rely;
	o3_fgbackground=ol_fgbackground;
	o3_bgbackground=ol_bgbackground;
	o3_padxl=ol_padxl;
	o3_padxr=ol_padxr;
	o3_padyt=ol_padyt;
	o3_padyb=ol_padyb;
	o3_fullhtml=ol_fullhtml;
	o3_vpos=ol_vpos;
	o3_aboveheight=ol_aboveheight;
	o3_capicon=ol_capicon;
	o3_textfont=ol_textfont;
	o3_captionfont=ol_captionfont;
	o3_closefont=ol_closefont;
	o3_textsize=ol_textsize;
	o3_captionsize=ol_captionsize;
	o3_closesize=ol_closesize;
	o3_timeout=ol_timeout;
	o3_function=ol_function;
	o3_delay=ol_delay;
	o3_hauto=ol_hauto;
	o3_vauto=ol_vauto;
	o3_closeclick=ol_closeclick;
	o3_wrap=ol_wrap;	
	o3_followmouse=ol_followmouse;
	o3_mouseoff=ol_mouseoff;
	o3_closetitle=ol_closetitle;
	o3_css=ol_css;
	o3_compatmode=ol_compatmode;
	o3_fgclass=ol_fgclass;
	o3_bgclass=ol_bgclass;
	o3_textfontclass=ol_textfontclass;
	o3_captionfontclass=ol_captionfontclass;
	o3_closefontclass=ol_closefontclass;
	
	setRunTimeVariables();
	
	fnRef = '';
	
	// Special for frame support, over must be reset...
	o3_frame = ol_frame;
	
	if(!(over=createDivContainer())) return false;

	parseTokens('o3_', overlib.arguments);
	if (!postParseChecks()) return false;

	if (o3_delay == 0) {
		return runHook("olMain", FREPLACE);
 	} else {
		o3_delayid = setTimeout("runHook('olMain', FREPLACE)", o3_delay);
		return false;
	}
}

// Clears popups if appropriate
function nd(time) {
	if (olLoaded && !isExclusive()) {
		hideDelay(time);  // delay popup close if time specified

		if (o3_removecounter >= 1) { o3_showingsticky = 0 };
		
		if (o3_showingsticky == 0) {
			o3_allowmove = 0;
			if (over != null && o3_timerid == 0) runHook("hideObject", FREPLACE, over);
		} else {
			o3_removecounter++;
		}
	}
	
	return true;
}

// The Close onMouseOver function for stickies
function cClick() {
	if (olLoaded) {
		runHook("hideObject", FREPLACE, over);
		o3_showingsticky = 0;	
	}	
	return false;
}

// Method for setting page specific defaults.
function overlib_pagedefaults() {
	parseTokens('ol_', overlib_pagedefaults.arguments);
}


////////
// OVERLIB MAIN FUNCTION
////////

// This function decides what it is we want to display and how we want it done.
function olMain() {
	var layerhtml, styleType;
 	runHook("olMain", FBEFORE);
 	
	if (o3_background!="" || o3_fullhtml) {
		// Use background instead of box.
		layerhtml = runHook('ol_content_background', FALTERNATE, o3_css, o3_text, o3_background, o3_fullhtml);
	} else {
		// They want a popup box.
		styleType = (pms[o3_css-1-pmStart] == "cssoff" || pms[o3_css-1-pmStart] == "cssclass");

		// Prepare popup background
		if (o3_fgbackground != "") o3_fgbackground = "background=\""+o3_fgbackground+"\"";
		if (o3_bgbackground != "") o3_bgbackground = (styleType ? "background=\""+o3_bgbackground+"\"" : o3_bgbackground);

		// Prepare popup colors
		if (o3_fgcolor != "") o3_fgcolor = (styleType ? "bgcolor=\""+o3_fgcolor+"\"" : o3_fgcolor);
		if (o3_bgcolor != "") o3_bgcolor = (styleType ? "bgcolor=\""+o3_bgcolor+"\"" : o3_bgcolor);

		// Prepare popup height
		if (o3_height > 0) o3_height = (styleType ? "height=\""+o3_height+"\"" : o3_height);
		else o3_height = "";

		// Decide which kinda box.
		if (o3_cap=="") {
			// Plain
			layerhtml = runHook('ol_content_simple', FALTERNATE, o3_css, o3_text);
		} else {
			// With caption
			if (o3_sticky) {
				// Show close text
				layerhtml = runHook('ol_content_caption', FALTERNATE, o3_css, o3_text, o3_cap, o3_close);
			} else {
				// No close text
				layerhtml = runHook('ol_content_caption', FALTERNATE, o3_css, o3_text, o3_cap, "");
			}
		}
	}	

	// We want it to stick!
	if (o3_sticky) {
		if (o3_timerid > 0) {
			clearTimeout(o3_timerid);
			o3_timerid = 0;
		}
		o3_showingsticky = 1;
		o3_removecounter = 0;
	}

	// Created a separate routine to generate the popup to make it easier
	// to implement a plugin capability
	if (!runHook("createPopup", FREPLACE, layerhtml)) return false;

	// Prepare status bar
	if (o3_autostatus > 0) {
		o3_status = o3_text;
		if (o3_autostatus > 1) o3_status = o3_cap;
	}

	// When placing the layer the first time, even stickies may be moved.
	o3_allowmove = 0;

	// Initiate a timer for timeout
	if (o3_timeout > 0) {          
		if (o3_timerid > 0) clearTimeout(o3_timerid);
		o3_timerid = setTimeout("cClick()", o3_timeout);
	}

	// Show layer
	runHook("disp", FREPLACE, o3_status);
	runHook("olMain", FAFTER);

	return (olOp && event && event.type == 'mouseover' && !o3_status) ? '' : (o3_status != '');
}

////////
// LAYER GENERATION FUNCTIONS
////////
// These functions just handle popup content with tags that should adhere to the W3C standards specification.

// Makes simple table without caption
function ol_content_simple(text) {
	var cpIsMultiple = /,/.test(o3_cellpad);
	var txt = '<table width="'+o3_width+ '" border="0" cellpadding="'+o3_border+'" cellspacing="0" '+(o3_bgclass ? 'class="'+o3_bgclass+'"' : o3_bgcolor+' '+o3_height)+'><tr><td><table width="100%" border="0" '+((olNs4||!cpIsMultiple) ? 'cellpadding="'+o3_cellpad+'" ' : '')+'cellspacing="0" '+(o3_fgclass ? 'class="'+o3_fgclass+'"' : o3_fgcolor+' '+o3_fgbackground+' '+o3_height)+'><tr><td valign="TOP"'+(o3_textfontclass ? ' class="'+o3_textfontclass+'">' : ((!olNs4&&cpIsMultiple) ? ' style="'+setCellPadStr(o3_cellpad)+'">' : '>'))+(o3_textfontclass ? '' : wrapStr(0,o3_textsize,'text'))+text+(o3_textfontclass ? '' : wrapStr(1,o3_textsize))+'</td></tr></table></td></tr></table>';

	set_background("");
	return txt;
}

// Makes table with caption and optional close link
function ol_content_caption(text,title,close) {
	var nameId, txt, cpIsMultiple = /,/.test(o3_cellpad);
	var closing, closeevent;

	closing = "";
	closeevent = "onmouseover";
	if (o3_closeclick == 1) closeevent = (o3_closetitle ? "title='" + o3_closetitle +"'" : "") + " onclick";
	if (o3_capicon != "") {
	  nameId = ' hspace = \"5\"'+' align = \"middle\" alt = \"\"';
	  if (typeof o3_dragimg != 'undefined' && o3_dragimg) nameId =' hspace=\"5\"'+' name=\"'+o3_dragimg+'\" id=\"'+o3_dragimg+'\" align=\"middle\" alt=\"Drag Enabled\" title=\"Drag Enabled\"';
	  o3_capicon = '<img src=\"'+o3_capicon+'\"'+nameId+' />';
	}

	if (close != "")
		closing = '<td '+(!o3_compatmode && o3_closefontclass ? 'class="'+o3_closefontclass : 'align="RIGHT')+'"><a href="javascript:return '+fnRef+'cClick();"'+((o3_compatmode && o3_closefontclass) ? ' class="' + o3_closefontclass + '" ' : ' ')+closeevent+'="return '+fnRef+'cClick();">'+(o3_closefontclass ? '' : wrapStr(0,o3_closesize,'close'))+close+(o3_closefontclass ? '' : wrapStr(1,o3_closesize,'close'))+'</a></td>';
	txt = '<table style="background-repeat:no-repeat;" width="'+o3_width+ '" border="0" cellpadding="'+o3_border+'" cellspacing="0" '+(o3_bgclass ? 'class="'+o3_bgclass+'"' : o3_bgcolor+' '+o3_bgbackground+' '+o3_height)+'><tr><td><table width="100%" border="0" cellpadding="2" cellspacing="0"><tr><td'+(o3_captionfontclass ? ' class="'+o3_captionfontclass+'">' : '>')+(o3_captionfontclass ? '' : '<b>'+wrapStr(0,o3_captionsize,'caption'))+o3_capicon+title+(o3_captionfontclass ? '' : wrapStr(1,o3_captionsize)+'</b>')+'</td>'+closing+'</tr></table><table width="100%" border="0" '+((olNs4||!cpIsMultiple) ? 'cellpadding="'+o3_cellpad+'" ' : '')+'cellspacing="0" '+(o3_fgclass ? 'class="'+o3_fgclass+'"' : o3_fgcolor+' '+o3_fgbackground+' '+o3_height)+'><tr><td valign="TOP"'+(o3_textfontclass ? ' class="'+o3_textfontclass+'">' :((!olNs4&&cpIsMultiple) ? ' style="'+setCellPadStr(o3_cellpad)+'">' : '>'))+(o3_textfontclass ? '' : wrapStr(0,o3_textsize,'text'))+text+(o3_textfontclass ? '' : wrapStr(1,o3_textsize)) + '</td></tr></table></td></tr></table>';

	set_background("");
	return txt;
}

// Sets the background picture,padding and lots more. :)
function ol_content_background(text,picture,hasfullhtml) {
	if (hasfullhtml) {
		txt=text;
	} else {
		txt='<table width="'+o3_width+'" border="0" cellpadding="0" cellspacing="0" height="'+o3_height+'"><tr><td colspan="3" height="'+o3_padyt+'"></td></tr><tr><td width="'+o3_padxl+'"></td><td valign="TOP" width="'+(o3_width-o3_padxl-o3_padxr)+(o3_textfontclass ? '" class="'+o3_textfontclass : '')+'">'+(o3_textfontclass ? '' : wrapStr(0,o3_textsize,'text'))+text+(o3_textfontclass ? '' : wrapStr(1,o3_textsize))+'</td><td width="'+o3_padxr+'"></td></tr><tr><td colspan="3" height="'+o3_padyb+'"></td></tr></table>';
	}

	set_background(picture);
	return txt;
}

// Loads a picture into the div.
function set_background(pic) {
	if (pic == "") {
		if (olNs4) {
			over.background.src = null; 
		} else if (over.style) {
			over.style.backgroundImage = "none";
		}
	} else {
		if (olNs4) {
			over.background.src = pic;
		} else if (over.style) {
			over.style.width=o3_width + 'px';
			over.style.backgroundImage = "url("+pic+")";
		}
	}
}

////////
// HANDLING FUNCTIONS
////////
var olShowId=-1;

// Displays the popup
function disp(statustext) {
	runHook("disp", FBEFORE);
	
	if (o3_allowmove == 0) {
		runHook("placeLayer", FREPLACE);
		(olNs6&&olShowId<0) ? olShowId=setTimeout("runHook('showObject', FREPLACE, over)", 1) : runHook("showObject", FREPLACE, over);
		o3_allowmove = (o3_sticky || o3_followmouse==0) ? 0 : 1;
	}
	
	runHook("disp", FAFTER);

	if (statustext != "") self.status = statustext;
}

// Creates the actual popup structure
function createPopup(lyrContent){
	runHook("createPopup", FBEFORE);
	
	if (o3_wrap) {
		var wd,ww,theObj = (olNs4 ? over : over.style);
		theObj.top = theObj.left = ((olIe4&&!olOp) ? 0 : -10000) + (!olNs4 ? 'px' : 0);
		layerWrite(lyrContent);
		wd = (olNs4 ? over.clip.width : over.offsetWidth);
		if (wd > (ww=windowWidth())) {
			lyrContent=lyrContent.replace(/\&nbsp;/g, ' ');
			o3_width=ww;
			o3_wrap=0;
		} 
	}

	layerWrite(lyrContent);
	
	// Have to set o3_width for placeLayer() routine if o3_wrap is turned on
	if (o3_wrap) o3_width=(olNs4 ? over.clip.width : over.offsetWidth);
	
	runHook("createPopup", FAFTER, lyrContent);

	return true;
}

// Decides where we want the popup.
function placeLayer() {
	var placeX, placeY, widthFix = 0;
	
	// HORIZONTAL PLACEMENT, re-arranged to work in Safari
	if (o3_frame.innerWidth) widthFix=18; 
	iwidth = windowWidth();

	// Horizontal scroll offset
	winoffset=(olIe4) ? eval('o3_frame.'+docRoot+'.scrollLeft') : o3_frame.pageXOffset;

	placeX = runHook('horizontalPlacement',FCHAIN,iwidth,winoffset,widthFix);

	// VERTICAL PLACEMENT, re-arranged to work in Safari
	if (o3_frame.innerHeight) {
		iheight=o3_frame.innerHeight;
	} else if (eval('o3_frame.'+docRoot)&&eval("typeof o3_frame."+docRoot+".clientHeight=='number'")&&eval('o3_frame.'+docRoot+'.clientHeight')) { 
		iheight=eval('o3_frame.'+docRoot+'.clientHeight');
	}			

	// Vertical scroll offset
	scrolloffset=(olIe4) ? eval('o3_frame.'+docRoot+'.scrollTop') : o3_frame.pageYOffset;
	placeY = runHook('verticalPlacement',FCHAIN,iheight,scrolloffset);

	// Actually move the object.
	repositionTo(over, placeX, placeY);
}

// Moves the layer
function olMouseMove(e) {
	var e = (e) ? e : event;

	if (e.pageX) {
		o3_x = e.pageX;
		o3_y = e.pageY;
	} else if (e.clientX) {
		o3_x = eval('e.clientX+o3_frame.'+docRoot+'.scrollLeft');
		o3_y = eval('e.clientY+o3_frame.'+docRoot+'.scrollTop');
	}
	
	if (o3_allowmove == 1) runHook("placeLayer", FREPLACE);

	// MouseOut handler
	if (hoveringSwitch && !olNs4 && runHook("cursorOff", FREPLACE)) {
		(olHideDelay ? hideDelay(olHideDelay) : cClick());
		hoveringSwitch = !hoveringSwitch;
	}
}

// Fake function for 3.0 users.
function no_overlib() { return ver3fix; }

// Capture the mouse and chain other scripts.
function olMouseCapture() {
	capExtent = document;
	var fN, str = '', l, k, f, wMv, sS, mseHandler = olMouseMove;
	var re = /function[ ]*(\w*)\(/;
	
	wMv = (!olIe4 && window.onmousemove);
	if (document.onmousemove || wMv) {
		if (wMv) capExtent = window;
		f = capExtent.onmousemove.toString();
		fN = f.match(re);
		if (fN == null) {
			str = f+'(e); ';
		} else if (fN[1] == 'anonymous' || fN[1] == 'olMouseMove' || (wMv && fN[1] == 'onmousemove')) {
			if (!olOp && wMv) {
				l = f.indexOf('{')+1;
				k = f.lastIndexOf('}');
				sS = f.substring(l,k);
				if ((l = sS.indexOf('(')) != -1) {
					sS = sS.substring(0,l).replace(/^\s+/,'').replace(/\s+$/,'');
					if (eval("typeof " + sS + " == 'undefined'")) window.onmousemove = null;
					else str = sS + '(e);';
				}
			}
			if (!str) {
				olCheckMouseCapture = false;
				return;
			}
		} else {
			if (fN[1]) str = fN[1]+'(e); ';
			else {
				l = f.indexOf('{')+1;
				k = f.lastIndexOf('}');
				str = f.substring(l,k) + '\n';
			}
		}
		str += 'olMouseMove(e); ';
		mseHandler = new Function('e', str);
	}

	capExtent.onmousemove = mseHandler;
	if (olNs4) capExtent.captureEvents(Event.MOUSEMOVE);
}

////////
// PARSING FUNCTIONS
////////

// Does the actual command parsing.
function parseTokens(pf, ar) {
	// What the next argument is expected to be.
	var v, i, mode=-1, par = (pf != 'ol_');	
	var fnMark = (par && !ar.length ? 1 : 0);

	for (i = 0; i < ar.length; i++) {
		if (mode < 0) {
			// Arg is maintext,unless its a number between pmStart and pmUpper
			// then its a command.
			if (typeof ar[i] == 'number' && ar[i] > pmStart && ar[i] < pmUpper) {
				fnMark = (par ? 1 : 0);
				i--;   // backup one so that the next block can parse it
			} else {
				switch(pf) {
					case 'ol_':
						ol_text = ar[i].toString();
						break;
					default:
						o3_text=ar[i].toString();  
				}
			}
			mode = 0;
		} else {
			// Note: NS4 doesn't like switch cases with vars.
			if (ar[i] >= pmCount || ar[i]==DONOTHING) { continue; }
			if (ar[i]==INARRAY) { fnMark = 0; eval(pf+'text=ol_texts['+ar[++i]+'].toString()'); continue; }
			if (ar[i]==CAPARRAY) { eval(pf+'cap=ol_caps['+ar[++i]+'].toString()'); continue; }
			if (ar[i]==STICKY) { if (pf!='ol_') eval(pf+'sticky=1'); continue; }
			if (ar[i]==BACKGROUND) { eval(pf+'background="'+ar[++i]+'"'); continue; }
			if (ar[i]==NOCLOSE) { if (pf!='ol_') opt_NOCLOSE(); continue; }
			if (ar[i]==CAPTION) { eval(pf+"cap='"+escSglQuote(ar[++i])+"'"); continue; }
			if (ar[i]==CENTER || ar[i]==LEFT || ar[i]==RIGHT) { eval(pf+'hpos='+ar[i]); if(pf!='ol_') olHautoFlag=1; continue; }
			if (ar[i]==OFFSETX) { eval(pf+'offsetx='+ar[++i]); continue; }
			if (ar[i]==OFFSETY) { eval(pf+'offsety='+ar[++i]); continue; }
			if (ar[i]==FGCOLOR) { eval(pf+'fgcolor="'+ar[++i]+'"'); continue; }
			if (ar[i]==BGCOLOR) { eval(pf+'bgcolor="'+ar[++i]+'"'); continue; }
			if (ar[i]==TEXTCOLOR) { eval(pf+'textcolor="'+ar[++i]+'"'); continue; }
			if (ar[i]==CAPCOLOR) { eval(pf+'capcolor="'+ar[++i]+'"'); continue; }
			if (ar[i]==CLOSECOLOR) { eval(pf+'closecolor="'+ar[++i]+'"'); continue; }
			if (ar[i]==WIDTH) { eval(pf+'width='+ar[++i]); continue; }
			if (ar[i]==BORDER) { eval(pf+'border='+ar[++i]); continue; }
			if (ar[i]==CELLPAD) { i=opt_MULTIPLEARGS(++i,ar,(pf+'cellpad')); continue; }
			if (ar[i]==STATUS) { eval(pf+"status='"+escSglQuote(ar[++i])+"'"); continue; }
			if (ar[i]==AUTOSTATUS) { eval(pf +'autostatus=('+pf+'autostatus == 1) ? 0 : 1'); continue; }
			if (ar[i]==AUTOSTATUSCAP) { eval(pf +'autostatus=('+pf+'autostatus == 2) ? 0 : 2'); continue; }
			if (ar[i]==HEIGHT) { eval(pf+'height='+pf+'aboveheight='+ar[++i]); continue; } // Same param again.
			if (ar[i]==CLOSETEXT) { eval(pf+"close='"+escSglQuote(ar[++i])+"'"); continue; }
			if (ar[i]==SNAPX) { eval(pf+'snapx='+ar[++i]); continue; }
			if (ar[i]==SNAPY) { eval(pf+'snapy='+ar[++i]); continue; }
			if (ar[i]==FIXX) { eval(pf+'fixx='+ar[++i]); continue; }
			if (ar[i]==FIXY) { eval(pf+'fixy='+ar[++i]); continue; }
			if (ar[i]==RELX) { eval(pf+'relx='+ar[++i]); continue; }
			if (ar[i]==RELY) { eval(pf+'rely='+ar[++i]); continue; }
			if (ar[i]==FGBACKGROUND) { eval(pf+'fgbackground="'+ar[++i]+'"'); continue; }
			if (ar[i]==BGBACKGROUND) { eval(pf+'bgbackground="'+ar[++i]+'"'); continue; }
			if (ar[i]==PADX) { eval(pf+'padxl='+ar[++i]); eval(pf+'padxr='+ar[++i]); continue; }
			if (ar[i]==PADY) { eval(pf+'padyt='+ar[++i]); eval(pf+'padyb='+ar[++i]); continue; }
			if (ar[i]==FULLHTML) { if (pf!='ol_') eval(pf+'fullhtml=1'); continue; }
			if (ar[i]==BELOW || ar[i]==ABOVE) { eval(pf+'vpos='+ar[i]); if (pf!='ol_') olVautoFlag=1; continue; }
			if (ar[i]==CAPICON) { eval(pf+'capicon="'+ar[++i]+'"'); continue; }
			if (ar[i]==TEXTFONT) { eval(pf+"textfont='"+escSglQuote(ar[++i])+"'"); continue; }
			if (ar[i]==CAPTIONFONT) { eval(pf+"captionfont='"+escSglQuote(ar[++i])+"'"); continue; }
			if (ar[i]==CLOSEFONT) { eval(pf+"closefont='"+escSglQuote(ar[++i])+"'"); continue; }
			if (ar[i]==TEXTSIZE) { eval(pf+'textsize="'+ar[++i]+'"'); continue; }
			if (ar[i]==CAPTIONSIZE) { eval(pf+'captionsize="'+ar[++i]+'"'); continue; }
			if (ar[i]==CLOSESIZE) { eval(pf+'closesize="'+ar[++i]+'"'); continue; }
			if (ar[i]==TIMEOUT) { eval(pf+'timeout='+ar[++i]); continue; }
			if (ar[i]==FUNCTION) { if (pf=='ol_') { if (typeof ar[i+1]!='number') { v=ar[++i]; ol_function=(typeof v=='function' ? v : null); }} else {fnMark = 0; v = null; if (typeof ar[i+1]!='number') v = ar[++i];  opt_FUNCTION(v); } continue; }
			if (ar[i]==DELAY) { eval(pf+'delay='+ar[++i]); continue; }
			if (ar[i]==HAUTO) { eval(pf+'hauto=('+pf+'hauto == 0) ? 1 : 0'); continue; }
			if (ar[i]==VAUTO) { eval(pf+'vauto=('+pf+'vauto == 0) ? 1 : 0'); continue; }
			if (ar[i]==CLOSECLICK) { eval(pf +'closeclick=('+pf+'closeclick == 0) ? 1 : 0'); continue; }
			if (ar[i]==WRAP) { eval(pf +'wrap=('+pf+'wrap == 0) ? 1 : 0'); continue; }
			if (ar[i]==FOLLOWMOUSE) { eval(pf +'followmouse=('+pf+'followmouse == 1) ? 0 : 1'); continue; }
			if (ar[i]==MOUSEOFF) { eval(pf +'mouseoff=('+pf+'mouseoff==0) ? 1 : 0'); v=ar[i+1]; if (pf != 'ol_' && eval(pf+'mouseoff') && typeof v == 'number' && (v < pmStart || v > pmUpper)) olHideDelay=ar[++i]; continue; }
			if (ar[i]==CLOSETITLE) { eval(pf+"closetitle='"+escSglQuote(ar[++i])+"'"); continue; }
			if (ar[i]==CSSOFF||ar[i]==CSSCLASS) { eval(pf+'css='+ar[i]); continue; }
			if (ar[i]==COMPATMODE) { eval(pf+'compatmode=('+pf+'compatmode==0) ? 1 : 0'); continue; }
			if (ar[i]==FGCLASS) { eval(pf+'fgclass="'+ar[++i]+'"'); continue; }
			if (ar[i]==BGCLASS) { eval(pf+'bgclass="'+ar[++i]+'"'); continue; }
			if (ar[i]==TEXTFONTCLASS) { eval(pf+'textfontclass="'+ar[++i]+'"'); continue; }
			if (ar[i]==CAPTIONFONTCLASS) { eval(pf+'captionfontclass="'+ar[++i]+'"'); continue; }
			if (ar[i]==CLOSEFONTCLASS) { eval(pf+'closefontclass="'+ar[++i]+'"'); continue; }
			i = parseCmdLine(pf, i, ar);
		}
	}

	if (fnMark && o3_function) o3_text = o3_function();
	
	if ((pf == 'o3_') && o3_wrap) {
		o3_width = 0;
		
		var tReg=/<.*\n*>/ig;
		if (!tReg.test(o3_text)) o3_text = o3_text.replace(/[ ]+/g, '&nbsp;');
		if (!tReg.test(o3_cap))o3_cap = o3_cap.replace(/[ ]+/g, '&nbsp;');
	}
	if ((pf == 'o3_') && o3_sticky) {
		if (!o3_close && (o3_frame != ol_frame)) o3_close = ol_close;
		if (o3_mouseoff && (o3_frame == ol_frame)) opt_NOCLOSE(' ');
	}
}


////////
// LAYER FUNCTIONS
////////

// Writes to a layer
function layerWrite(txt) {
	txt += "\n";
	if (olNs4) {
		var lyr = o3_frame.document.layers['overDiv'].document
		lyr.write(txt)
		lyr.close()
	} else if (typeof over.innerHTML != 'undefined') {
		if (olIe5 && isMac) over.innerHTML = '';
		over.innerHTML = txt;
	} else {
		range = o3_frame.document.createRange();
		range.setStartAfter(over);
		domfrag = range.createContextualFragment(txt);
		
		while (over.hasChildNodes()) {
			over.removeChild(over.lastChild);
		}
		
		over.appendChild(domfrag);
	}
}

// Make an object visible
function showObject(obj) {
	runHook("showObject", FBEFORE);

	var theObj=(olNs4 ? obj : obj.style);
	theObj.visibility = 'visible';

	runHook("showObject", FAFTER);
}

// Hides an object
function hideObject(obj) {
	runHook("hideObject", FBEFORE);

	var theObj=(olNs4 ? obj : obj.style);
	if (olNs6 && olShowId>0) { clearTimeout(olShowId); olShowId=0; }
	theObj.visibility = 'hidden';
	theObj.top = theObj.left = ((olIe4&&!olOp) ? 0 : -10000) + (!olNs4 ? 'px' : 0);

	if (o3_timerid > 0) clearTimeout(o3_timerid);
	if (o3_delayid > 0) clearTimeout(o3_delayid);

	o3_timerid = 0;
	o3_delayid = 0;
	self.status = "";

	if (obj.onmouseout||obj.onmouseover) {
		if (olNs4) obj.releaseEvents(Event.MOUSEOUT || Event.MOUSEOVER);
		obj.onmouseout = obj.onmouseover = null;
	}

	runHook("hideObject", FAFTER);
}

// Move a layer
function repositionTo(obj, xL, yL) {
	var theObj=(olNs4 ? obj : obj.style);
	theObj.left = xL + (!olNs4 ? 'px' : 0);
	theObj.top = yL + (!olNs4 ? 'px' : 0);
}

// Check position of cursor relative to overDiv DIVision; mouseOut function
function cursorOff() {
	var left = parseInt(over.style.left);
	var top = parseInt(over.style.top);
	var right = left + (over.offsetWidth >= parseInt(o3_width) ? over.offsetWidth : parseInt(o3_width));
	var bottom = top + (over.offsetHeight >= o3_aboveheight ? over.offsetHeight : o3_aboveheight);

	if (o3_x < left || o3_x > right || o3_y < top || o3_y > bottom) return true;

	return false;
}


////////
// COMMAND FUNCTIONS
////////

// Calls callme or the default function.
function opt_FUNCTION(callme) {
	o3_text = (callme ? (typeof callme=='string' ? (/.+\(.*\)/.test(callme) ? eval(callme) : callme) : callme()) : (o3_function ? o3_function() : 'No Function'));

	return 0;
}

// Handle hovering
function opt_NOCLOSE(unused) {
	if (!unused) o3_close = "";

	if (olNs4) {
		over.captureEvents(Event.MOUSEOUT || Event.MOUSEOVER);
		over.onmouseover = function () { if (o3_timerid > 0) { clearTimeout(o3_timerid); o3_timerid = 0; } }
		over.onmouseout = function (e) { if (olHideDelay) hideDelay(olHideDelay); else cClick(e); }
	} else {
		over.onmouseover = function () {hoveringSwitch = true; if (o3_timerid > 0) { clearTimeout(o3_timerid); o3_timerid =0; } }
	}

	return 0;
}

// Function to scan command line arguments for multiples
function opt_MULTIPLEARGS(i, args, parameter) {
  var k=i, re, pV, str='';

  for(k=i; k<args.length; k++) {
		if(typeof args[k] == 'number' && args[k]>pmStart) break;
		str += args[k] + ',';
	}
	if (str) str = str.substring(0,--str.length);

	k--;  // reduce by one so the for loop this is in works correctly
	pV=(olNs4 && /cellpad/i.test(parameter)) ? str.split(',')[0] : str;
	eval(parameter + '="' + pV + '"');

	return k;
}

// Remove &nbsp; in texts when done.
function nbspCleanup() {
	if (o3_wrap) {
		o3_text = o3_text.replace(/\&nbsp;/g, ' ');
		o3_cap = o3_cap.replace(/\&nbsp;/g, ' ');
	}
}

// Escape embedded single quotes in text strings
function escSglQuote(str) {
  return str.toString().replace(/'/g,"\\'");
}

// Onload handler for window onload event
function OLonLoad_handler(e) {
	var re = /\w+\(.*\)[;\s]+/g, olre = /overlib\(|nd\(|cClick\(/, fn, l, i;

	if(!olLoaded) olLoaded=1;

  // Remove it for Gecko based browsers
	if(window.removeEventListener && e.eventPhase == 3) window.removeEventListener("load",OLonLoad_handler,false);
	else if(window.detachEvent) { // and for IE and Opera 4.x but execute calls to overlib, nd, or cClick()
		window.detachEvent("onload",OLonLoad_handler);
		var fN = document.body.getAttribute('onload');
		if (fN) {
			fN=fN.toString().match(re);
			if (fN && fN.length) {
				for (i=0; i<fN.length; i++) {
					if (/anonymous/.test(fN[i])) continue;
					while((l=fN[i].search(/\)[;\s]+/)) != -1) {
						fn=fN[i].substring(0,l+1);
						fN[i] = fN[i].substring(l+2);
						if (olre.test(fn)) eval(fn);
					}
				}
			}
		}
	}
}

// Wraps strings in Layer Generation Functions with the correct tags
//    endWrap true(if end tag) or false if start tag
//    fontSizeStr - font size string such as '1' or '10px'
//    whichString is being wrapped -- 'text', 'caption', or 'close'
function wrapStr(endWrap,fontSizeStr,whichString) {
	var fontStr, fontColor, isClose=((whichString=='close') ? 1 : 0), hasDims=/[%\-a-z]+$/.test(fontSizeStr);
	fontSizeStr = (olNs4) ? (!hasDims ? fontSizeStr : '1') : fontSizeStr;
	if (endWrap) return (hasDims&&!olNs4) ? (isClose ? '</span>' : '</div>') : '</font>';
	else {
		fontStr='o3_'+whichString+'font';
		fontColor='o3_'+((whichString=='caption')? 'cap' : whichString)+'color';
		return (hasDims&&!olNs4) ? (isClose ? '<span style="font-family: '+quoteMultiNameFonts(eval(fontStr))+'; color: '+eval(fontColor)+'; font-size: '+fontSizeStr+';">' : '<div style="font-family: '+quoteMultiNameFonts(eval(fontStr))+'; color: '+eval(fontColor)+'; font-size: '+fontSizeStr+';">') : '<font face="'+eval(fontStr)+'" color="'+eval(fontColor)+'" size="'+(parseInt(fontSizeStr)>7 ? '7' : fontSizeStr)+'">';
	}
}

// Quotes Multi word font names; needed for CSS Standards adherence in font-family
function quoteMultiNameFonts(theFont) {
	var v, pM=theFont.split(',');
	for (var i=0; i<pM.length; i++) {
		v=pM[i];
		v=v.replace(/^\s+/,'').replace(/\s+$/,'');
		if(/\s/.test(v) && !/['"]/.test(v)) {
			v="\'"+v+"\'";
			pM[i]=v;
		}
	}
	return pM.join();
}

// dummy function which will be overridden 
function isExclusive(args) {
	return false;
}

// Sets cellpadding style string value
function setCellPadStr(parameter) {
	var Str='', j=0, ary = new Array(), top, bottom, left, right;

	Str+='padding: ';
	ary=parameter.replace(/\s+/g,'').split(',');

	switch(ary.length) {
		case 2:
			top=bottom=ary[j];
			left=right=ary[++j];
			break;
		case 3:
			top=ary[j];
			left=right=ary[++j];
			bottom=ary[++j];
			break;
		case 4:
			top=ary[j];
			right=ary[++j];
			bottom=ary[++j];
			left=ary[++j];
			break;
	}

	Str+= ((ary.length==1) ? ary[0] + 'px;' : top + 'px ' + right + 'px ' + bottom + 'px ' + left + 'px;');

	return Str;
}

// function will delay close by time milliseconds
function hideDelay(time) {
	if (time&&!o3_delay) {
		if (o3_timerid > 0) clearTimeout(o3_timerid);

		o3_timerid=setTimeout("cClick()",(o3_timeout=time));
	}
}

// Was originally in the placeLayer() routine; separated out for future ease
function horizontalPlacement(browserWidth, horizontalScrollAmount, widthFix) {
	var placeX, iwidth=browserWidth, winoffset=horizontalScrollAmount;
	var parsedWidth = parseInt(o3_width);

	if (o3_fixx > -1 || o3_relx != null) {
		// Fixed position
		placeX=(o3_relx != null ? ( o3_relx < 0 ? winoffset +o3_relx+ iwidth - parsedWidth - widthFix : winoffset+o3_relx) : o3_fixx);
	} else {  
		// If HAUTO, decide what to use.
		if (o3_hauto == 1) {
			if ((o3_x - winoffset) > (iwidth / 2)) {
				o3_hpos = LEFT;
			} else {
				o3_hpos = RIGHT;
			}
		}  		

		// From mouse
		if (o3_hpos == CENTER) { // Center
			placeX = o3_x+o3_offsetx-(parsedWidth/2);

			if (placeX < winoffset) placeX = winoffset;
		}

		if (o3_hpos == RIGHT) { // Right
			placeX = o3_x+o3_offsetx;

			if ((placeX+parsedWidth) > (winoffset+iwidth - widthFix)) {
				placeX = iwidth+winoffset - parsedWidth - widthFix;
				if (placeX < 0) placeX = 0;
			}
		}
		if (o3_hpos == LEFT) { // Left
			placeX = o3_x-o3_offsetx-parsedWidth;
			if (placeX < winoffset) placeX = winoffset;
		}  	

		// Snapping!
		if (o3_snapx > 1) {
			var snapping = placeX % o3_snapx;

			if (o3_hpos == LEFT) {
				placeX = placeX - (o3_snapx+snapping);
			} else {
				// CENTER and RIGHT
				placeX = placeX+(o3_snapx - snapping);
			}

			if (placeX < winoffset) placeX = winoffset;
		}
	}	

	return placeX;
}

// was originally in the placeLayer() routine; separated out for future ease
function verticalPlacement(browserHeight,verticalScrollAmount) {
	var placeY, iheight=browserHeight, scrolloffset=verticalScrollAmount;
	var parsedHeight=(o3_aboveheight ? parseInt(o3_aboveheight) : (olNs4 ? over.clip.height : over.offsetHeight));

	if (o3_fixy > -1 || o3_rely != null) {
		// Fixed position
		placeY=(o3_rely != null ? (o3_rely < 0 ? scrolloffset+o3_rely+iheight - parsedHeight : scrolloffset+o3_rely) : o3_fixy);
	} else {
		// If VAUTO, decide what to use.
		if (o3_vauto == 1) {
			if ((o3_y - scrolloffset) > (iheight / 2) && o3_vpos == BELOW && (o3_y + parsedHeight + o3_offsety - (scrolloffset + iheight) > 0)) {
				o3_vpos = ABOVE;
			} else if (o3_vpos == ABOVE && (o3_y - (parsedHeight + o3_offsety) - scrolloffset < 0)) {
				o3_vpos = BELOW;
			}
		}

		// From mouse
		if (o3_vpos == ABOVE) {
			if (o3_aboveheight == 0) o3_aboveheight = parsedHeight; 

			placeY = o3_y - (o3_aboveheight+o3_offsety);
			if (placeY < scrolloffset) placeY = scrolloffset;
		} else {
			// BELOW
			placeY = o3_y+o3_offsety;
		} 

		// Snapping!
		if (o3_snapy > 1) {
			var snapping = placeY % o3_snapy;  			

			if (o3_aboveheight > 0 && o3_vpos == ABOVE) {
				placeY = placeY - (o3_snapy+snapping);
			} else {
				placeY = placeY+(o3_snapy - snapping);
			} 			

			if (placeY < scrolloffset) placeY = scrolloffset;
		}
	}

	return placeY;
}

// checks positioning flags
function checkPositionFlags() {
	if (olHautoFlag) olHautoFlag = o3_hauto=0;
	if (olVautoFlag) olVautoFlag = o3_vauto=0;
	return true;
}

// get Browser window width
function windowWidth() {
	var w;
	if (o3_frame.innerWidth) w=o3_frame.innerWidth;
	else if (eval('o3_frame.'+docRoot)&&eval("typeof o3_frame."+docRoot+".clientWidth=='number'")&&eval('o3_frame.'+docRoot+'.clientWidth')) 
		w=eval('o3_frame.'+docRoot+'.clientWidth');
	return w;			
}

// create the div container for popup content if it doesn't exist
function createDivContainer(id,frm,zValue) {
	id = (id || 'overDiv'), frm = (frm || o3_frame), zValue = (zValue || 1000);
	var objRef, divContainer = layerReference(id);

	if (divContainer == null) {
		if (olNs4) {
			divContainer = frm.document.layers[id] = new Layer(window.innerWidth, frm);
			objRef = divContainer;
		} else {
			var body = (olIe4 ? frm.document.all.tags('BODY')[0] : frm.document.getElementsByTagName("BODY")[0]);
			if (olIe4&&!document.getElementById) {
				body.insertAdjacentHTML("beforeEnd",'<div id="'+id+'"></div>');
				divContainer=layerReference(id);
			} else {
				divContainer = frm.document.createElement("DIV");
				divContainer.id = id;
				body.appendChild(divContainer);
			}
			objRef = divContainer.style;
		}

		objRef.position = 'absolute';
		objRef.visibility = 'hidden';
		objRef.zIndex = zValue;
		if (olIe4&&!olOp) objRef.left = objRef.top = '0px';
		else objRef.left = objRef.top =  -10000 + (!olNs4 ? 'px' : 0);
	}

	return divContainer;
}

// get reference to a layer with ID=id
function layerReference(id) {
	return (olNs4 ? o3_frame.document.layers[id] : (document.all ? o3_frame.document.all[id] : o3_frame.document.getElementById(id)));
}
////////
//  UTILITY FUNCTIONS
////////

// Checks if something is a function.
function isFunction(fnRef) {
	var rtn = true;

	if (typeof fnRef == 'object') {
		for (var i = 0; i < fnRef.length; i++) {
			if (typeof fnRef[i]=='function') continue;
			rtn = false;
			break;
		}
	} else if (typeof fnRef != 'function') {
		rtn = false;
	}
	
	return rtn;
}

// Converts an array into an argument string for use in eval.
function argToString(array, strtInd, argName) {
	var jS = strtInd, aS = '', ar = array;
	argName=(argName ? argName : 'ar');
	
	if (ar.length > jS) {
		for (var k = jS; k < ar.length; k++) aS += argName+'['+k+'], ';
		aS = aS.substring(0, aS.length-2);
	}
	
	return aS;
}

// Places a hook in the correct position in a hook point.
function reOrder(hookPt, fnRef, order) {
	var newPt = new Array(), match, i, j;

	if (!order || typeof order == 'undefined' || typeof order == 'number') return hookPt;
	
	if (typeof order=='function') {
		if (typeof fnRef=='object') {
			newPt = newPt.concat(fnRef);
		} else {
			newPt[newPt.length++]=fnRef;
		}
		
		for (i = 0; i < hookPt.length; i++) {
			match = false;
			if (typeof fnRef == 'function' && hookPt[i] == fnRef) {
				continue;
			} else {
				for(j = 0; j < fnRef.length; j++) if (hookPt[i] == fnRef[j]) {
					match = true;
					break;
				}
			}
			if (!match) newPt[newPt.length++] = hookPt[i];
		}

		newPt[newPt.length++] = order;

	} else if (typeof order == 'object') {
		if (typeof fnRef == 'object') {
			newPt = newPt.concat(fnRef);
		} else {
			newPt[newPt.length++] = fnRef;
		}
		
		for (j = 0; j < hookPt.length; j++) {
			match = false;
			if (typeof fnRef == 'function' && hookPt[j] == fnRef) {
				continue;
			} else {
				for (i = 0; i < fnRef.length; i++) if (hookPt[j] == fnRef[i]) {
					match = true;
					break;
				}
			}
			if (!match) newPt[newPt.length++]=hookPt[j];
		}

		for (i = 0; i < newPt.length; i++) hookPt[i] = newPt[i];
		newPt.length = 0;
		
		for (j = 0; j < hookPt.length; j++) {
			match = false;
			for (i = 0; i < order.length; i++) {
				if (hookPt[j] == order[i]) {
					match = true;
					break;
				}
			}
			if (!match) newPt[newPt.length++] = hookPt[j];
		}
		newPt = newPt.concat(order);
	}

	hookPt = newPt;

	return hookPt;
}

////////
//  PLUGIN ACTIVATION FUNCTIONS
////////

// Runs plugin functions to set runtime variables.
function setRunTimeVariables(){
	if (typeof runTime != 'undefined' && runTime.length) {
		for (var k = 0; k < runTime.length; k++) {
			runTime[k]();
		}
	}
}

// Runs plugin functions to parse commands.
function parseCmdLine(pf, i, args) {
	if (typeof cmdLine != 'undefined' && cmdLine.length) { 
		for (var k = 0; k < cmdLine.length; k++) { 
			var j = cmdLine[k](pf, i, args);
			if (j >- 1) {
				i = j;
				break;
			}
		}
	}

	return i;
}

// Runs plugin functions to do things after parse.
function postParseChecks(pf,args){
	if (typeof postParse != 'undefined' && postParse.length) {
		for (var k = 0; k < postParse.length; k++) {
			if (postParse[k](pf,args)) continue;
			return false;  // end now since have an error
		}
	}
	return true;
}


////////
//  PLUGIN REGISTRATION FUNCTIONS
////////

// Registers commands and creates constants.
function registerCommands(cmdStr) {
	if (typeof cmdStr!='string') return;

	var pM = cmdStr.split(',');
	pms = pms.concat(pM);

	for (var i = 0; i< pM.length; i++) {
		eval(pM[i].toUpperCase()+'='+pmCount++);
	}
}

// Registers no-parameter commands
function registerNoParameterCommands(cmdStr) {
	if (!cmdStr && typeof cmdStr != 'string') return;
	pmt=(!pmt) ? cmdStr : pmt + ',' + cmdStr;
}

// Register a function to hook at a certain point.
function registerHook(fnHookTo, fnRef, hookType, optPm) {
	var hookPt, last = typeof optPm;
	
	if (fnHookTo == 'plgIn'||fnHookTo == 'postParse') return;
	if (typeof hookPts[fnHookTo] == 'undefined') hookPts[fnHookTo] = new FunctionReference();

	hookPt = hookPts[fnHookTo];

	if (hookType != null) {
		if (hookType == FREPLACE) {
			hookPt.ovload = fnRef;  // replace normal overlib routine
			if (fnHookTo.indexOf('ol_content_') > -1) hookPt.alt[pms[CSSOFF-1-pmStart]]=fnRef; 

		} else if (hookType == FBEFORE || hookType == FAFTER) {
			var hookPt=(hookType == 1 ? hookPt.before : hookPt.after);

			if (typeof fnRef == 'object') {
				hookPt = hookPt.concat(fnRef);
			} else {
				hookPt[hookPt.length++] = fnRef;
			}

			if (optPm) hookPt = reOrder(hookPt, fnRef, optPm);

		} else if (hookType == FALTERNATE) {
			if (last=='number') hookPt.alt[pms[optPm-1-pmStart]] = fnRef;
		} else if (hookType == FCHAIN) {
			hookPt = hookPt.chain; 
			if (typeof fnRef=='object') hookPt=hookPt.concat(fnRef); // add other functions 
			else hookPt[hookPt.length++]=fnRef;
		}

		return;
	}
}

// Register a function that will set runtime variables.
function registerRunTimeFunction(fn) {
	if (isFunction(fn)) {
		if (typeof fn == 'object') {
			runTime = runTime.concat(fn);
		} else {
			runTime[runTime.length++] = fn;
		}
	}
}

// Register a function that will handle command parsing.
function registerCmdLineFunction(fn){
	if (isFunction(fn)) {
		if (typeof fn == 'object') {
			cmdLine = cmdLine.concat(fn);
		} else {
			cmdLine[cmdLine.length++] = fn;
		}
	}
}

// Register a function that does things after command parsing. 
function registerPostParseFunction(fn){
	if (isFunction(fn)) {
		if (typeof fn == 'object') {
			postParse = postParse.concat(fn);
		} else {
			postParse[postParse.length++] = fn;
		}
	}
}

////////
//  PLUGIN REGISTRATION FUNCTIONS
////////

// Runs any hooks registered.
function runHook(fnHookTo, hookType) {
	var l = hookPts[fnHookTo], k, rtnVal = null, optPm, arS, ar = runHook.arguments;

	if (hookType == FREPLACE) {
		arS = argToString(ar, 2);

		if (typeof l == 'undefined' || !(l = l.ovload)) rtnVal = eval(fnHookTo+'('+arS+')');
		else rtnVal = eval('l('+arS+')');

	} else if (hookType == FBEFORE || hookType == FAFTER) {
		if (typeof l != 'undefined') {
			l=(hookType == 1 ? l.before : l.after);
	
			if (l.length) {
				arS = argToString(ar, 2);
				for (var k = 0; k < l.length; k++) eval('l[k]('+arS+')');
			}
		}
	} else if (hookType == FALTERNATE) {
		optPm = ar[2];
		arS = argToString(ar, 3);

		if (typeof l == 'undefined' || (l = l.alt[pms[optPm-1-pmStart]]) == 'undefined') {
			rtnVal = eval(fnHookTo+'('+arS+')');
		} else {
			rtnVal = eval('l('+arS+')');
		}
	} else if (hookType == FCHAIN) {
		arS=argToString(ar,2);
		l=l.chain;

		for (k=l.length; k > 0; k--) if((rtnVal=eval('l[k-1]('+arS+')'))!=void(0)) break;
	}

	return rtnVal;
}

////////
// OBJECT CONSTRUCTORS
////////

// Object for handling hooks.
function FunctionReference() {
	this.ovload = null;
	this.before = new Array();
	this.after = new Array();
	this.alt = new Array();
	this.chain = new Array();
}

// Object for simple access to the overLIB version used.
// Examples: simpleversion:351 major:3 minor:5 revision:1
function Info(version, prerelease) {
	this.version = version;
	this.prerelease = prerelease;

	this.simpleversion = Math.round(this.version*100);
	this.major = parseInt(this.simpleversion / 100);
	this.minor = parseInt(this.simpleversion / 10) - this.major * 10;
	this.revision = parseInt(this.simpleversion) - this.major * 100 - this.minor * 10;
	this.meets = meets;
}

// checks for Core Version required
function meets(reqdVersion) {
	return (!reqdVersion) ? false : this.simpleversion >= Math.round(100*parseFloat(reqdVersion));
}


////////
// STANDARD REGISTRATIONS
////////
registerHook("ol_content_simple", ol_content_simple, FALTERNATE, CSSOFF);
registerHook("ol_content_caption", ol_content_caption, FALTERNATE, CSSOFF);
registerHook("ol_content_background", ol_content_background, FALTERNATE, CSSOFF);
registerHook("ol_content_simple", ol_content_simple, FALTERNATE, CSSCLASS);
registerHook("ol_content_caption", ol_content_caption, FALTERNATE, CSSCLASS);
registerHook("ol_content_background", ol_content_background, FALTERNATE, CSSCLASS);
registerPostParseFunction(checkPositionFlags);
registerHook("hideObject", nbspCleanup, FAFTER);
registerHook("horizontalPlacement", horizontalPlacement, FCHAIN);
registerHook("verticalPlacement", verticalPlacement, FCHAIN);
if (olNs4||(olIe5&&isMac)||olKq) olLoaded=1;
registerNoParameterCommands('sticky,autostatus,autostatuscap,fullhtml,hauto,vauto,closeclick,wrap,followmouse,mouseoff,compatmode');
///////
// ESTABLISH MOUSECAPTURING
///////

// Capture events, alt. diffuses the overlib function.
var olCheckMouseCapture=true;
if ((olNs4 || olNs6 || olIe4)) {
	olMouseCapture();
} else {
	overlib = no_overlib;
	nd = no_overlib;
	ver3fix = true;
}// JavaScript Document
$(function () {
  $('.bubbleInfo').each(function () {
    // options
    var distance = 10;
    var time = 250;
    var hideDelay = 5;

    var hideDelayTimer = null;

    // tracker
    var beingShown = false;
    var shown = false;
    
    var trigger = $('.trigger', this);
    var popup = $('.popup', this).css('opacity', 0);

    // set the mouseover and mouseout on both element
    $([trigger.get(0), popup.get(0)]).mouseover(function () {
      // stops the hide event if we move from the trigger to the popup element
      if (hideDelayTimer) clearTimeout(hideDelayTimer);

      // don't trigger the animation again if we're being shown, or already visible
      if (beingShown || shown) {
        return;
      } else {
        beingShown = true;

        // reset position of popup box
        popup.css({
          top: -170,
          left: 50,
          display: 'block' // brings the popup back in to view
        })

        // (we're using chaining on the popup) now animate it's opacity and position
        .animate({
          top: '-=' + distance + 'px',
          opacity: 1
        }, time, 'swing', function() {
          // once the animation is complete, set the tracker variables
          beingShown = false;
          shown = true;
        });
      }
    }).mouseout(function () {
      // reset the timer if we get fired again - avoids double animations
      if (hideDelayTimer) clearTimeout(hideDelayTimer);
      
      // store the timer so that it can be cleared in the mouseover if required
      hideDelayTimer = setTimeout(function () {
        hideDelayTimer = null;
        popup.animate({
          top: '-=' + distance + 'px',
          opacity: 0
        }, time, 'swing', function () {
          // once the animate is complete, set the tracker variables
          shown = false;
          // hide the popup entirely after the effect (opacity alone doesn't do the job)
          popup.css('display', 'none');
        });
      }, hideDelay);
    });
  });
});function default_focus(element, text) {
	if (element.value == text) {
		element.value = '';
		element.style.color = '';
		element.style.backgroundColor = '';
	}
}function verifyContactForm(form) {
	var l = form.elements.length, field, bad, v;
	var rtnval = true;
	for (var x = 0; x < l; x ++) {
		field = form.elements[x];
		bad = false;
		
		switch (field.name) {
			case 'name':
				v = trim(field.value);
				field.value = v;
				if (v.length < 1) { bad = true; }
			break;
			case 'email':
				v = trim(field.value);
				field.value = v;
				if (!v.match(/^[a-z0-9!#\$%&\'*+\-\/=?\^_`{|}~]+@[a-z0-9.\-]+\.[a-z0-9\-]+$/)) {
					bad = true;
				}
			break;
			case 'phone':
				v = trim(v);
				if (v.length < 1) { bad = true; }
			break;			
		}

		if (bad) {		
			field.style.backgroundColor = '#fcc';
			field.onfocus = function() { this.style.backgroundColor = ''; }
			rtnval = false;
		}		
	}
	return rtnval;
}
function correctPNG() { 
}

// correctly handle PNG transparency in Win IE 5.5 & 6.
correctPNG.prototype = {

	onload:	function() {
               var arVersion = navigator.appVersion.split("MSIE")
               var version = parseFloat(arVersion[1])
               if ((version >= 5.5) && (document.body.filters))
               {
                  for(var i=0; i<document.images.length; i++)
                  {
                     var img = document.images[i]
                     var imgName = img.src.toUpperCase()
                     if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
                     {
                        var imgID = (img.id) ? "id='" + img.id + "' " : ""
                        var imgClass = (img.className) ? "class='" + img.className + "' " : ""
                        var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
                        var imgStyle = "display:inline-block;" + img.style.cssText
                        if (img.align == "left") imgStyle = "float:left;" + imgStyle
                        if (img.align == "right") imgStyle = "float:right;" + imgStyle
                        if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle
                        var strNewHTML = "<span " + imgID + imgClass + imgTitle
                        + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
                        + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
                        + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>"
                        img.outerHTML = strNewHTML
                        i = i-1
                     }
                  }
               }
	}
};

addOnLoadQueue(new correctPNG());
//** AnyLink JS Drop Down Menu v2.0- (c) Dynamic Drive DHTML code library: http://www.dynamicdrive.com
//** Script Download/ instructions page: http://www.dynamicdrive.com/dynamicindex1/dropmenuindex.htm
//** January 29th, 2009: Script Creation date

//**May 22nd, 09': v2.1
//1) Automatically adds a "selectedanchor" CSS class to the currrently selected anchor link
//2) For image anchor links, the custom HTML attributes "data-image" and "data-overimage" can be inserted to set the anchor's default and over images.

//**June 1st, 09': v2.2
//1) Script now runs automatically after DOM has loaded. anylinkmenu.init) can now be called in the HEAD section

if (typeof dd_domreadycheck=="undefined") //global variable to detect if DOM is ready
var dd_domreadycheck=false

var anylinkmenu={

    menusmap: {},
    preloadimages: [],
    effects: {delayhide: 200, shadow:{enabled:true, opacity:0.3, depth: [5, 5]}, fade:{enabled:false, duration:500}}, //customize menu effects

    dimensions: {},

    getoffset:function(what, offsettype){
        return (what.offsetParent)? what[offsettype]+this.getoffset(what.offsetParent, offsettype) : what[offsettype]
    },

    getoffsetof:function(el){
        el._offsets={left:this.getoffset(el, "offsetLeft"), top:this.getoffset(el, "offsetTop"), h: el.offsetHeight}
    },

    getdimensions:function(menu){
        this.dimensions={anchorw:menu.anchorobj.offsetWidth, anchorh:menu.anchorobj.offsetHeight,
        docwidth:(window.innerWidth ||this.standardbody.clientWidth)-20,
        docheight:(window.innerHeight ||this.standardbody.clientHeight)-15,
        docscrollx:window.pageXOffset || this.standardbody.scrollLeft,
        docscrolly:window.pageYOffset || this.standardbody.scrollTop
        }
        if (!this.dimensions.dropmenuw){
            this.dimensions.dropmenuw=menu.dropmenu.offsetWidth
            this.dimensions.dropmenuh=menu.dropmenu.offsetHeight
        }
    },

    isContained:function(m, e){
        var e=window.event || e
        var c=e.relatedTarget || ((e.type=="mouseover")? e.fromElement : e.toElement)
        while (c && c!=m)try {c=c.parentNode} catch(e){c=m}
        if (c==m)
        return true
        else
        return false
    },

    setopacity:function(el, value){
        el.style.opacity=value
        if (typeof el.style.opacity!="string"){ //if it's not a string (ie: number instead), it means property not supported
            el.style.MozOpacity=value
            if (el.filters){
                el.style.filter="progid:DXImageTransform.Microsoft.alpha(opacity="+ value*100 +")"
            }
        }
    },

    showmenu:function(menuid){
        var menu=anylinkmenu.menusmap[menuid]
        clearTimeout(menu.hidetimer)
        this.getoffsetof(menu.anchorobj)
        this.getdimensions(menu)
        var posx=menu.anchorobj._offsets.left + (menu.orientation=="lr"? this.dimensions.anchorw : 0) //base x pos
        var posy=menu.anchorobj._offsets.top+this.dimensions.anchorh - (menu.orientation=="lr"? this.dimensions.anchorh : 0)//base y pos
        if (posx+this.dimensions.dropmenuw+this.effects.shadow.depth[0]>this.dimensions.docscrollx+this.dimensions.docwidth){ //drop left instead?
            posx=posx-this.dimensions.dropmenuw + (menu.orientation=="lr"? -this.dimensions.anchorw : this.dimensions.anchorw)
        }
        if (posy+this.dimensions.dropmenuh>this.dimensions.docscrolly+this.dimensions.docheight){  //drop up instead?
            posy=Math.max(posy-this.dimensions.dropmenuh - (menu.orientation=="lr"? -this.dimensions.anchorh : this.dimensions.anchorh), this.dimensions.docscrolly) //position above anchor or window's top edge
        }
        if (this.effects.fade.enabled){
            this.setopacity(menu.dropmenu, 0) //set opacity to 0 so menu appears hidden initially
            if (this.effects.shadow.enabled)
            this.setopacity(menu.shadow, 0) //set opacity to 0 so shadow appears hidden initially
        }
        menu.dropmenu.setcss({left:posx+'px', top:posy+'px', visibility:'visible'})
        if (this.effects.shadow.enabled){
            //menu.shadow.setcss({width: menu.dropmenu.offsetWidth+"px", height:menu.dropmenu.offsetHeight+"px"})
            menu.shadow.setcss({left:posx+anylinkmenu.effects.shadow.depth[0]+'px', top:posy+anylinkmenu.effects.shadow.depth[1]+'px', visibility:'visible'})
        }
        if (this.effects.fade.enabled){
            clearInterval(menu.animatetimer)
            menu.curanimatedegree=0
            menu.starttime=new Date().getTime() //get time just before animation is run
            menu.animatetimer=setInterval(function(){anylinkmenu.revealmenu(menuid)}, 20)
        }
    },

    revealmenu:function(menuid){
        var menu=anylinkmenu.menusmap[menuid]
        var elapsed=new Date().getTime()-menu.starttime //get time animation has run
        if (elapsed<this.effects.fade.duration){
            this.setopacity(menu.dropmenu, menu.curanimatedegree)
            if (this.effects.shadow.enabled)
            this.setopacity(menu.shadow, menu.curanimatedegree*this.effects.shadow.opacity)
        }
        else{
            clearInterval(menu.animatetimer)
            this.setopacity(menu.dropmenu, 1)
            menu.dropmenu.style.filter=""
        }
        menu.curanimatedegree=(1-Math.cos((elapsed/this.effects.fade.duration)*Math.PI)) / 2
    },

    setcss:function(param){
        for (prop in param){
            this.style[prop]=param[prop]
        }
    },

    setcssclass:function(el, targetclass, action){
        var needle=new RegExp("(^|\\s+)"+targetclass+"($|\\s+)", "ig")
        if (action=="check")
        return needle.test(el.className)
        else if (action=="remove")
        el.className=el.className.replace(needle, "")
        else if (action=="add" && !needle.test(el.className))
        el.className+=" "+targetclass
    },

    hidemenu:function(menuid){
        var menu=anylinkmenu.menusmap[menuid]
        clearInterval(menu.animatetimer)
        menu.dropmenu.setcss({visibility:'hidden', left:0, top:0})
        menu.shadow.setcss({visibility:'hidden', left:0, top:0})
    },

    getElementsByClass:function(targetclass){
        if (document.querySelectorAll)
        return document.querySelectorAll("."+targetclass)
        else{
            var classnameRE=new RegExp("(^|\\s+)"+targetclass+"($|\\s+)", "i") //regular expression to screen for classname
            var pieces=[]
            var alltags=document.all? document.all : document.getElementsByTagName("*")
            for (var i=0; i<alltags.length; i++){
                if (typeof alltags[i].className=="string" && alltags[i].className.search(classnameRE)!=-1)
                pieces[pieces.length]=alltags[i]
            }
            return pieces
        }
    },

    addDiv:function(divid, divclass, inlinestyle){
        var el=document.createElement("div")
        //if (divid)  el.id=divid
        el.id=el.className=divclass
        if (inlinestyle!="" && typeof el.style.cssText=="string")
        el.style.cssText=inlinestyle
        else if (inlinestyle!="")
        el.setAttribute('style', inlinestyle)
        document.body.appendChild(el)
        return el
    },

    getmenuHTML:function(menuobj){
        var menucontent=[]
        var frag=""

        //MENU LINKS CODE
        for (var i=0; i<menuobj.items.length; i++)
        {
            frag+='<li id="' +menuobj.items[i][1] + '" class="hot_link"><a onclick="return getExtensions(this)" href="#" >' + menuobj.items[i][0] + '</a></li>\n'
            if (menuobj.items[i][2]=="efc" || i==menuobj.items.length-1){
                menucontent.push(frag)
                frag=""
            }
        }
        if (typeof menuobj.cols=="undefined")
        return '<ul>\n' + menucontent.join('') + '\n</ul>'
        else{
            frag=""
            for (var i=0; i<menucontent.length; i++){
                frag+='<div class="' + menuobj.cols.divclass + '" style="' + menuobj.cols.inlinestyle + '">\n<ul>\n' + menucontent[i] + '</ul>\n</div>\n'
            }
            return frag
        }
    },

    addEvent:function(targetarr, functionref, tasktype){
        if (targetarr.length>0){
            var target=targetarr.shift()
            if (target.addEventListener)
            target.addEventListener(tasktype, functionref, false)
            else if (target.attachEvent)
            target.attachEvent('on'+tasktype, function(){return functionref.call(target, window.event)})
            this.addEvent(targetarr, functionref, tasktype)
        }
    },

    domready:function(functionref){ //based on code from the jQuery library
        if (dd_domreadycheck){
            functionref()
            return
        }
        // Mozilla, Opera and webkit nightlies currently support this event
        if (document.addEventListener) {
            // Use the handy event callback
            document.addEventListener("DOMContentLoaded", function(){
                document.removeEventListener("DOMContentLoaded", arguments.callee, false )
                functionref();
                dd_domreadycheck=true
            }, false )
        }
        else if (document.attachEvent){
            // If IE and not an iframe
            // continually check to see if the document is ready
            if ( document.documentElement.doScroll && window == window.top) (function(){
                if (dd_domreadycheck) return
                try{
                    // If IE is used, use the trick by Diego Perini
                    // http://javascript.nwbox.com/IEContentLoaded/
                    document.documentElement.doScroll("left")
                }catch(error){
                    setTimeout( arguments.callee, 0)
                    return;
                }
                //and execute any waiting functions
                functionref();
                dd_domreadycheck=true
            })();
        }
        if (document.attachEvent && parent.length>0) //account for page being in IFRAME, in which above doesn't fire in IE
        this.addEvent(window, function(){functionref()}, "load");
    },

    addState:function(anchorobj, state){
        if (anchorobj.getAttribute('data-image')){
            var imgobj=(anchorobj.tagName=="IMG")? anchorobj : anchorobj.getElementsByTagName('img')[0]
            if (imgobj){
                imgobj.src=(state=="add")? anchorobj.getAttribute('data-overimage') : anchorobj.getAttribute('data-image')
            }
        }
        else
        anylinkmenu.setcssclass(anchorobj, "selectedanchor", state)
    },

    addState:function(anchorobj, state){
        if (anchorobj.getAttribute('data-image')){
            var imgobj=(anchorobj.tagName=="IMG")? anchorobj : anchorobj.getElementsByTagName('img')[0]
            if (imgobj){
                imgobj.src=(state=="add")? anchorobj.getAttribute('data-overimage') : anchorobj.getAttribute('data-image')
            }
        }
        else
        anylinkmenu.setcssclass(anchorobj, "selectedanchor", state)
    },

    setupmenu:function(targetclass, anchorobj, pos){
        this.standardbody=(document.compatMode=="CSS1Compat")? document.documentElement : document.body
        var relattr=anchorobj.getAttribute("rel")
        dropmenuid=relattr.replace(/\[(\w+)\]/, '')
        var dropmenuvar=window[dropmenuid]
        var dropmenu=this.addDiv(null, dropmenuvar.divclass, dropmenuvar.inlinestyle) //create and add main sub menu DIV
        dropmenu.innerHTML=this.getmenuHTML(dropmenuvar)
        var menu=this.menusmap[targetclass+pos]={
            id: targetclass+pos,
            anchorobj: anchorobj,
            dropmenu: dropmenu,
            revealtype: (relattr.length!=dropmenuid.length && RegExp.$1=="click")? "click" : "mouseover",
            orientation: anchorobj.getAttribute("rev")=="lr"? "lr" : "ud",
            shadow: this.addDiv(null, "anylinkshadow", null) //create and add corresponding shadow
        }
        menu.anchorobj._internalID=targetclass+pos
        menu.anchorobj._isanchor=true
        menu.dropmenu._internalID=targetclass+pos
        menu.shadow._internalID=targetclass+pos
        menu.dropmenu.setcss=this.setcss
        menu.shadow.setcss=this.setcss
        menu.shadow.setcss({width: menu.dropmenu.offsetWidth+"px", height:menu.dropmenu.offsetHeight+"px"})
        this.setopacity(menu.shadow, this.effects.shadow.opacity)
        this.addEvent([menu.anchorobj, menu.dropmenu, menu.shadow], function(e){ //MOUSEOVER event for anchor, dropmenu, shadow
            var menu=anylinkmenu.menusmap[this._internalID]
            if (this._isanchor && menu.revealtype=="mouseover" && !anylinkmenu.isContained(this, e)){ //event for anchor
                anylinkmenu.showmenu(menu.id)
                anylinkmenu.addState(this, "add")
            }
            else if (typeof this._isanchor=="undefined"){ //event for drop down menu and shadow
                clearTimeout(menu.hidetimer)
            }
        }, "mouseover")
        this.addEvent([menu.anchorobj, menu.dropmenu, menu.shadow], function(e){ //MOUSEOUT event for anchor, dropmenu, shadow
            if (!anylinkmenu.isContained(this, e)){
                var menu=anylinkmenu.menusmap[this._internalID]
                menu.hidetimer=setTimeout(function(){
                    anylinkmenu.addState(menu.anchorobj, "remove")
                    anylinkmenu.hidemenu(menu.id)
                }, anylinkmenu.effects.delayhide)
            }
        }, "mouseout")
        this.addEvent([menu.anchorobj, menu.dropmenu], function(e){ //CLICK event for anchor, dropmenu
            var menu=anylinkmenu.menusmap[this._internalID]
            if ( this._isanchor && menu.revealtype=="click"){
                if (menu.dropmenu.style.visibility=="visible")
                anylinkmenu.hidemenu(menu.id)
                else{
                    anylinkmenu.addState(this, "add")
                    anylinkmenu.showmenu(menu.id)
                }
                if (e.preventDefault)
                e.preventDefault()
                return false
            }
            //last condition removed to keep menu from hiding when a click event occurs. jtg 2009-10-13
            //else menu.hidetimer=setTimeout(function(){anylinkmenu.hidemenu(menu.id)}, anylinkmenu.effects.delayhide)
        }, "click")
    },

    init:function(targetclass){
        this.domready(function(){anylinkmenu.trueinit(targetclass)})
    },

    trueinit:function(targetclass){
        var anchors=this.getElementsByClass(targetclass)
        var preloadimages=this.preloadimages
        for (var i=0; i<anchors.length; i++){
            if (anchors[i].getAttribute('data-image')){ //preload anchor image?
                preloadimages[preloadimages.length]=new Image()
                preloadimages[preloadimages.length-1].src=anchors[i].getAttribute('data-image')
            }
            if (anchors[i].getAttribute('data-overimage')){ //preload anchor image?
                preloadimages[preloadimages.length]=new Image()
                preloadimages[preloadimages.length-1].src=anchors[i].getAttribute('data-overimage')
            }
            this.setupmenu(targetclass, anchors[i], i)
        }
    }

}

/***************************************
    New Simulated Dropdown
***************************************/

var extensionLists={divclass:'anylinkmenu', inlinestyle:'', linktarget:''} //First menu variable. Make sure "extensionLists" is a unique name!

//anylinkmenu.init("menu_anchors_class") //Pass in the CSS class of anchor links (that contain a sub menu)
anylinkmenu.init("menuanchorclass");

/* get section title from the clicked option id. */
_get_section_key = function(obj_id) {  var tlds_type_parse = obj_id.split("_");    return tlds_type_parse[1];  }

/**
* GET EXTENSION LINKS
*/
getExtensions = function(obj)
{
    var list = obj.parentNode.parentNode; //parent 'ul'
    var listItems = list.childNodes; //all 'li's
    var selected = obj.parentNode; //parent 'li'

    var linkHolderID = _get_section_key(selected.id);

    //cycle through existing list to handle object selection
    for ( i=listItems.length; i>=0; i--)
    {
        if( listItems[i] != undefined && listItems[i].id != undefined )
        {
            var listItem = listItems[i];
            var listItemID = listItem.id;

            //if selected view already exists toggle closed - if other view is open, close
            if( listItemID == linkHolderID || listItem.className != 'hot_link' )
            {
                list.removeChild(listItem);

                if( listItemID == linkHolderID )
                {   list.style.height = "135px";  return false;  } //stop here if toggling closed
            }

            //create new links object
            if( listItemID == selected.id )
            {
                //create extension links holder
                var linkHolder = document.createElement('li');
                linkHolder.id = linkHolderID;

                list.appendChild(linkHolder);
                list.style.height = "275px";

                //create extension links
                for(var j in link_list[linkHolderID])
                {
                    var linkObj = document.createElement('a');
                    linkObj.style.color = "#000";
                    linkObj.style.paddingLeft = "12px";
                    linkObj.rel = "nofollow";
                    linkObj.id = linkObj.href = j;
                    linkObj.innerHTML = link_list[linkHolderID][j];

                    linkHolder.appendChild(linkObj);
                }
            }   //end create new links
        }   //end dom object check
    }   //end list loop

    //stop handled event
    return false;
}


/**
* MOUSEOVER FOR DROP DOWN SIMULATOR
*/
function hover(obj)
{
    obj.originalBG = obj.style.backgroundImage;
    obj.style.backgroundImage = "url(/images/en_US/template/dropdown_over.jpg)";

    obj.onmouseout = function(){ this.style.backgroundImage = obj.originalBG;  }
}

/**
* GET IDN LINKS
*/
function getIDNs(obj)
{
    if( obj.innerHTML == "Menu: Internationalized Domains" )
    {
        var linkHolder = document.getElementById('anylinkmenu');
        linkHolder.innerHTML = '';

        var list = document.createElement('ul');
        linkHolder.appendChild(list);

        list.style.height = "275px";

        var listObj = document.createElement('li');
        list.appendChild(listObj);

        for( var j in link_list )
        {
            var linkObj = document.createElement('a');
            linkObj.style.color = "#000";
            linkObj.rel = "nofollow";
            linkObj.href = link_list[j] ;
            linkObj.id = j;
            linkObj.innerHTML = 'IDN in ' + j;

            listObj.appendChild(linkObj);
        }
    }
}

