var nagFailureFlag=false;
var x54_default_root="http://www.nethaggler.com/";
var html="";
html += '<div id="x54_haggletag_" onmousedown="x54roi.beginrect(event,this,\'x54_haggletag_\',\'x54_roipanel_\')">';
html += '</div>';
html += '<img id="x54topmsg" src="http://www.nethaggler.com/images/drawrect.gif" />';
html += '<div id="x54_roipanel_" onmousemove="x54roi.setCursor(event,this)" onmousedown="x54roi.beginrect(event,this,\'x54_haggletag_\',\'x54_roipanel_\')"></div>';
 html += '<div id="x54dialog" class="nagphgle_main_boxm">';
  html += '  <!--header start-->';
  html += '  <div class="nagphd_for_header" style="height:auto;" onmousedown="x54dlg.begindmove(event)" align="left"><img src="' + x54_root + 'images/nagp_logo.gif" alt="Nethaggler" width="181" height="47">&nbsp;</div>';
  html += '  <!--IMG CONTANT-->';
  html += '<div class="contantm" align="left" style="clear: both;"><img src="' + x54_root + 'images/nag_popclose.gif"  alt="close" width="13" height="13" border="0" class="closem" onmousedown="location.reload();">';
  html += '  <div style="padding: 11px; clear: both; width: 400px; color:#000; text-align:left;">';
  html += '		<div id="welcomeUser" margin:0px padding:0px; color:#1d5e06; clear: both; border:1px solid #5d5c5c; position: relative;">Welcome Guest</div>';
  html += '  <div id="change_user" style="clear: both; width:240px; line-height:18px; color: #000000; position: relative;">&nbsp;</div></div>';
  html += '    <div class="img_inf_boxm">';
  html += '      <div class="nagp_img_bxm fl" id="x54prodimgpanel" align="left"><img id="x54prod_img" src="http://www.nethaggler.com/images/noimage.gif" alt="image" ></div>';
  html += '      <div class="nagp_detail fl" >';
  html += '        <div id="x54proddescpanel"><div id="x54prod_title" class="nam_txt"  >&nbsp;</div>';
  html += '        <div id="x54prod_desc" class="nam_txt_lineD">&nbsp;</div>';
  html += '        <div id="x54prod_curprice" class="nam_txt_lineD" style="font-weight:bold; color:red;">&nbsp;</div>';
  html += '	</div><div id="x54ajaxloader" style="padding-top: 20px; vertical-align: middle; text-align: center;" class="nam_txt_lineD"><img src="http://www.nethaggler.com/images/ajaxloader.gif"><br /><br /><strong>Please Wait, Product is loading.<br />it may take 1-2 minutes..</strong></div>';
  html += '	</div>';
  html += '</div>';
  html += '    <!--IMG CONTANT FINISH-->';
  html +='<style>';
html +='.tabs	 {float:left;  width:509px; font-size:11px; line-height:normal; margin: 0px;}';
html +='.tabs ul {margin: 0px 0px 0px 0px;padding:5px 5px 0px 0px; list-style:none;    }';
html +='.tabs li {display:inline; margin:0px;mt padding: 0; color: #fff;}';
html +='.tabs li a: hover{ color: #475f07;}';
html +='.tabs a {float:left; margin:0px 0px 0px 3px; padding:0px 0px 0px 7px; text-decoration:none;}';
html +='.tabs a span {float:left; display:block; padding:5px 12px 4px 5px; /*color:#fff;*/ margin: 0px; font:bold 12px tahoma, Verdana, Arial, Helvetica, sans-serif ;}';
html +='.submit_ft_buttonm{	height: 24px; width: 61px; border: none; font: bold 11px Arial, Helvetica, sans-serif; color: #404e06; margin:  0; letter-spacing: 1px; padding:0px 1px 2px 0px; }';
html +='.line_fr_lbl{ margin: 0 ; padding: 0; height: 18px; width: 180px; clear:both ;}';
html +='  </style>';
  html += '    <div class="nagp_form_bxm">';
//to show the offer Details
html += '<br/><div id="showOffer" style="margin-bottom:1px;"></div><br/>'
  html += '      <div class="tabs" id="x54tabbar">';
  if(document.URL.indexOf("http://www.officemax.com") != -1 || document.URL.indexOf(".techdepot.com") != -1)
  {
	  html += '          <li id="x54tag" ><a style="background:url(' + x54_root + '/images/nagp_menuleft_bg.gif) no-repeat left top; outline: none; cursor: pointer;" title="tag"><span class="active_btnng" style="background:url('+ x54_root +'/images/nagp_menuright_bg.gif) no-repeat right top; outline: none;">Tag</span></a></li>';
	  html += '          <li id="x54nag" ><a style="background:url(' + x54_root + '/images/nagp_menuleft_bg.gif) no-repeat left top; outline: none; cursor: pointer;" title="nag"><span class="inactive_btnng" style="background:url('+ x54_root +'/images/nagp_menuright_bg.gif) no-repeat right top; outline: none;">Nag</span></a></li>';
	  html += '          <li id="x54haggle"><a style="background:url(' + x54_root + '/images/nagp_menuleft_bg.gif) no-repeat left top; outline: none; cursor: pointer;" title="haggle"><span class="inactive_btnng" style="background:url('+ x54_root +'/images/nagp_menuright_bg.gif) no-repeat right top; outline: none;">Haggle</span></a></li>';
  }
  else
  {
  	  html += '        <ul style="width:400px;">';
	  html += '          <li id="x54tag" ><a style="background:url(' + x54_root + '/images/nagp_menuleft_bg.gif) no-repeat left top; outline: none; cursor: pointer;" title="tag"><span class="active_btnng" style="background:url('+ x54_root +'/images/nagp_menuright_bg.gif) no-repeat right top; outline: none;">Tag</span></a></li>';
	  html += '          <li id="x54nag" ><a style="background:url(' + x54_root + '/images/nagp_menuleft_bg.gif) no-repeat left top; outline: none; cursor: pointer;" title="nag"><span class="inactive_btnng" style="background:url('+ x54_root +'/images/nagp_menuright_bg.gif) no-repeat right top; outline: none;">Nag</span></a></li>';
	  html += '          <li id="x54haggle"><a style="background:url(' + x54_root + '/images/nagp_menuleft_bg.gif) no-repeat left top; outline: none; cursor: pointer;" title="haggle"><span class="inactive_btnng" style="background:url('+ x54_root +'/images/nagp_menuright_bg.gif) no-repeat right top; outline: none;">Haggle</span></a></li>';
	  html += '        </ul>';
  }
  html += '      </div>';
 //Tag Pannel
  html += '      <div  id="x54tagpanel" class="nagp_cont_bx fl" >';
  html += '        <form class="margin_zerom" id="x54tagform" onsubmit="return false;">';
  html += '        <div id="x54taginput" class="nag_tb_contlft fl">';
  html += '          <div  style="height: auto; width: auto; padding: 0; margin: 0; float: left;">';
  html += '            <div  class="nagp_tagxt_fldleft fl"> <!-- <span class="nagp_hdtg_xt">Tag the item for price watch</span> -->';
  html += '              <div class="nag_haggle_contbx"> </div>';
  html += '              <div style="clear:both; margin-right: 24px; " class="fl">';
  html += '                  <div class="nagp_tbx_div">';
  html += '                    <label>Tag Price($):</label>';
  html += '                    <input id="x54tag_price" tabindex="1" type="text" class="nagp_txt_areaL" style="border:1px solid #81a123">';
  html += '                  </div>';
  html += '                  <div class="nagp_tbx_div">';
  html += '                    <label id="x54tag_emailcap">E-mail:</label><span id="x54tag_emailSpan">';
  html += '                    <input id="x54tag_email" tabindex="3" type="text" class="nagp_txt_areaL" style="border:1px solid #81a123"></span>';
  html += '                  </div>';
  //button for NH and FB in tag pannel
  html += '				<div id="x54tag_loginPannelForFaceBook">';
  //html += '                  <div style="padding:7px 0 10px 40px; cursor:pointer" class="fl"><img src="' + x54_root + 'images/netHagglerActBtn.gif" alt="nethaggler" onclick=\'x54dlg.changeUser("x54tag")\' title="NetHaggler user" /></div>';
  html += '                  <div style="padding:7px 0 10px 40px; cursor:pointer" class="fl"><img src="' + x54_root + 'images/facbookActBtn.gif" alt="nethaggler" onclick=\'x54dlg.connectFBUser()\' title="NetHaggler user" /></div>';
  html += '				</div>';
  html += '              </div>';
  html += '              <div class="nag_txar_bxrght fl" style="text-align:right; ">';
  html += '				<div class="nagp_tbx_div"><span style="vertical-align:top">Quantity:</span>&nbsp;';
  html += '                  <input value="1" tabindex="2" id="x54tag_quantity" type="text" maxlength="3" style="width:100px;" class="nagp_txt_areaL" style="border:1px solid #81a123"></div>';
  html += '                  <div class="nagp_tbx_div"><span id="x54tag_passcap" style="vertical-align:top">Password:</span>&nbsp;';
  html += '                  <span id="x54tag_PwdSpan"><input tabindex="4" id="x54tag_password" value="" type="password" style="width:100px;" class="nagp_txt_areaL" style="border:1px solid #81a123"></span>';
  html += '                  </div>';
 
  
 
  html += '                </div>';
  html += '              </div>';
  html += '            </div>';
  html += '            <div class="nagp_error_tg"> ';
  html += '              <div id="x54tagmsg" class="nagp_err_line" align="center" style="visibility: hidden;" >&nbsp;</div> ';
  html += '            </div> ';
  if(document.URL.match(".autopartswarehouse.com"))
  	html += '            <div class="nagp_btn_tg" align="right"  style="text-align: right; width:400px;" > ';
  else
  	html += '            <div class="nagp_btn_tg" align="right" > ';
  html += '              <input id="tagButton" name="Submit" style="float:none; background: url(' + x54_root + '/images/nag_pft_btn.gif) no-repeat; outline: none;"  onclick="x54dlg.saveTag(); " type="submit" class="submit_ft_buttonm" value="Tag"> ';
  html += '              <input name="Submit" style="float:none; background: url(' + x54_root + '/images/nag_pft_btn.gif) no-repeat; outline: none;"  onclick="location.reload()" type="submit" class="submit_ft_buttonm" value="Close"> ';
  html += '            </div> ';
  html += '  					<div style="clear: both;"></div>';
  html += '          </div>';
  if(document.URL.indexOf("http://www.tactics.com") != -1)
  	html += '<div class="nag_tbnag_cntrgt" align="center" style="height: 50px; width: 37px;"><br>';          
  else	
  	html += '          <div class="nag_tbnag_cntrgt" align="center"><br>';  	
  html += '            <img src="'+ x54_root + 'images/nagp_tagimg.gif" alt="tag" width="37" height="50"><br>';
  html += '          </div>';
  html += '                </form>';
  html += '        </div>';
  
  //Nag Pannel
   html += '  <div id="x54nagpanel"  class="nagp_cont_bx fl" style="display:none;"> ';
   html += '            <div class="nag_tb_contlft fl" > ';
   html += '  		      <form id="x54nagform" onsubmit="return false;" class="margin_zerom"> ';
   html += '				<input id="nag_discount" type="hidden" value="-1" />';
   html += '              <div id="x54naginput"> ';
   html += '                <div class="nagp_tagxt_fldleft fl" > ';
   html += '                  <div style="clear:both; margin: 0 24px 0 0; "class="fl"> ';
   html += '                      <div class="nagp_tbx_div"> ';
   html += '                        <label>Nag Price($):</label>';
   html += '                        <input tabindex="1" id="x54nag_price" type="text" class="nagp_txt_areaL"> ';
   html += '                      </div> ';
   html += '                      <div class="nagp_tbx_div"> ';
   html += '                        <label id="x54nag_emailcap">E-mail:</label><span id="x54nag_emailSpan"> ';
   html += '                        <input id="x54nag_email" tabindex="3" type="text" class="nagp_txt_areaL" ></span>';
   html += '                      </div> ';
   
   //button for NH and FB in nag pannel
   html += '				<div id="x54nag_loginPannelForFaceBook">';
   //html += '                  <div style="padding:7px 0 10px 40px; cursor:pointer" class="fl"><img src="' + x54_root + 'images/netHagglerActBtn.gif" alt="nethaggler" onclick=\'x54dlg.changeUser("x54tag")\' title="NetHaggler user" /></div>';
   html += '                  <div style="padding:7px 0 10px 40px;" class="fl"><img style="cursor:pointer;" src="' + x54_root + 'images/facbookActBtn.gif" alt="nethaggler" onclick=\'x54dlg.connectFBUser()\' title="NetHaggler user" /></div>';
   html += '				</div>';
   
   html += '                  </div> ';
   html += '                  <div class="nag_txar_bxrght fl" style="text-align:right;" >';
   html += '  				<div class="nagp_tbx_div"><span style="vertical-align:top">Quantity:</span>&nbsp;';
   html += '                    <input id="x54nag_quantity" tabindex="2" type="text" maxlength="3" style="width:100px;" class="nagp_txt_areaL" /></div>';
   html += '                    <div class="nagp_tbx_div"> <span id="x54nag_passcap" style="vertical-align:top">Password:</span>&nbsp;';
   html += '                     <span id="x54nag_PwdSpan"> <input tabindex="4" id="x54nag_password" value="" type="password" style="width:100px;" class="nagp_txt_areaL" /></span>';
   html += '                    </div>';
   
   html += '                  </div> ';
   html += '                </div> ';
   html += '                <div class="nagp_txarea_div" id="nag2"> Reasons for discount: </div> ';
   html += '                <div class="nagp_txarea_div" id="nag3"> ';
   html += '                  <textarea id="x54nag_message"  class="nagp_txt_boxL" ></textarea> ';
   html += '                </div> ';
   html += '              </div> ';
   html += '  			<div class="nagp_error_tg"> ';
   html += '                <div id="x54nagmsgFaliue" class="nagp_err_line2" style="display:none;"></div> ';
   html += '                <div id="x54nagmsg" class="nagp_err_line" align="center"></div> ';
   html += '              </div>';
   if(document.URL.match(".autopartswarehouse.com"))
   html += '              <div class="nagp_btn_tg" align="right" style="text-align: right; width:400px;"> ';
   else
   html += '              <div class="nagp_btn_tg" align="right"> ';
   html += ' <div style=" float:right;  width:260px;">';//<iframe height="35" width="120" frameborder="0" scrolling="no" style="margin-top: 0px;  float:left;" src="http://192.168.0.127:8080/home/fbconnect.html"></iframe>';
   html += '                <div style="float:right; width:130px; padding-top:10px;"><input id="x54nag_save"  style="background: url(' + x54_root + '/images/nag_pft_btn.gif) no-repeat; outline: none;" onclick="x54dlg.saveTag();" type="submit" class="submit_ft_buttonm" value="Nag" /> ';
   html += '                <input id="x54nag_close"  style="background: url(' + x54_root + '/images/nag_pft_btn.gif) no-repeat; outline: none;" type="submit" onclick="location.reload()" class="submit_ft_buttonm" value="Close" /> ';
   html += '              </div></div></div>';
   html += '  			 </form> ';
   html += '           </div> ';
   if(document.URL.indexOf("http://www.tactics.com") != -1)
   html += '            <div class="nag_tbnag_cnt" align="center" style="height: 50px; width: 37px;">';
   else
   html += '            <div class="nag_tbnag_cnt" align="center">';
   html += '            <img src="' + x54_root + 'images/nagp_nagimg.gif" alt="tag" width="37" height="50" class="img"><br /> ';
   html += '            </div>';
   html += '        </div>';
//Haggle Pannel
   html += ' <div id="x54hagglepanel" class="nagp_cont_bx fl" style="display:none;" > ';
   html += '           <div class="nag_tb_contlft fl"><input id="x54haggle_groupid" type="hidden" value="-1"/>';
   html += ' 		      <form id="x54haggleform" onsubmit="return false;" class="margin_zerom">';
   html += '             <div class="nag_tb_contlft fl" id="x54haggleinput"> ';
   html += '               <div class="nagp_tagxt_fldleft fl"><!-- <span class="nagp_hdtg_xt">Haggle collectively with other NetHagglers</span> -->';
   html += '                 <div class="nag_haggle_contbx"> ';
   html += '                   <div class="nag_haggle_listbx fl" > ';
   html += '                     <div id="nagp_hdfr_status" align="center" ><b>Offer Price</b></div> ';
   html += '                    <div class="cnt_price_lbl"><p><label>Lowest :</label><span id="x54haggle_lowest">$0.00</span></p>';
   html += ' 					<p><label>Median :</label><span id="x54haggle_median">$0.00</span></p>';
   html += ' 					 <p><label>Highest :</label><span id="x54haggle_highest">$0.00</span></p></div>';
   html += '                   </div> ';
	html += '<div class="nag_bx_sgn fl">';
	html += '<div id="nagp_hdfr_sighn" align="center" ><b>Sign up </b></div> ';
	html += '	<div class="cnt_sign_lbl"><div class="line_fr_lbl"><label>Minimum Required:</label>';
	html += '	  <span id="x54haggle_threshold"><input id="x54nag_price4" type="text" class="txt_era_fld" /></span>';
	html += '  </div>  ';
	html += '    <div class="line_fr_lbl">';
	html += '      <label>Active Signup:</label>';
	html += '      <span id="x54haggle_current"><input  id="x54nag_price42" type="text" class="txt_era_fld" /></span>';
	html += '</div>';
	html += '  <div class="line_fr_lbl" style="display:none;">';
	html += '      <label>Active Boy :</label>';
	html += '      <span id="x54haggle_required"><input id="x54nag_price43" type="text" class="txt_era_fld" /></span>';
	html += '</div></div>';
	html += '</div>';
  // html += '                   </div> ';
   html += '                 </div> ';
   html += '                 <div style="clear:both; margin-right: 24px; " class="fl"> ';
   html += '                     <div class="nagp_tbx_div"> ';
   html += '                       <label>Haggle Price($):</label> ';
   html += '                       <input tabindex="1" id="x54haggle_price" type="text" class="nagp_txt_areaL"> ';
   html += '                     </div> ';
   html += '                     <div class="nagp_tbx_div"> ';
   html += '                       <label id="x54haggle_emailcap">E-mail:</label><span id="x54haggle_emailSpan"> ';
   html += '                       <input tabindex="3" id="x54haggle_email" type="text" class="nagp_txt_areaL" ></span> ';
   html += '                     </div> ';
   //button for NH and FB in Haggle pannel
   html += '				<div id="x54haggle_loginPannelForFaceBook">';
  // html += '                  <div style="padding:7px 0 10px 40px; cursor:pointer" class="fl"><img src="' + x54_root + 'images/netHagglerActBtn.gif" alt="nethaggler" onclick=\'x54dlg.changeUser("x54tag")\' title="NetHaggler user" /></div>';
   html += '                  <div style="padding:7px 0 10px 40px; cursor:pointer" class="fl"><img src="' + x54_root + 'images/facbookActBtn.gif" alt="nethaggler" onclick=\'x54dlg.connectFBUser()\' title="NetHaggler user" /></div>';
   html += '				</div>';
   
   html += '                                  </div> ';
   html += '                 <div class="nag_txar_bxrght fl" style="text-align:right;">';
   html += ' 				<div class="nagp_tbx_div"><span style="vertical-align:top">Quantity:</span>&nbsp;';
   html += '                   <input tabindex="2" id="x54haggle_quantity" type="text" maxlength="3" style="width:100px;" class="nagp_txt_areaL"></div>';
   html += '                   <div class="nagp_tbx_div"> <span  id="x54haggle_passcap" style="vertical-align:top">Password:</span>&nbsp;';
   html += '                     <span id="x54haggle_PwdSpan"><input tabindex="4" id="x54haggle_password"  value="" type="password" style="width:100px;" class="nagp_txt_areaL"></span>';
   html += '                   </div>';
   
   html += '                 </div> ';
   html += '               </div> ';
   html += '             </div> ';
   html += '             <div class="nagp_error_tg"> ';
   html += '               <div class="nagp_err_line" id="x54hagglemsg" align="center">&nbsp;</div> ';
   html += '             </div> ';
   if(document.URL.match(".autopartswarehouse.com"))
   html += '             <div class="nagp_btn_tg" align="right" style="text-align: right; width:400px;"> ';
   else
   html += '             <div class="nagp_btn_tg" align="right"> ';
   html += '               <input name="Submit"  style="background: url(' + x54_root + '/images/nag_pft_btn.gif) no-repeat; outline: none;"  type="submit" onclick="x54dlg.saveTag();" class="submit_ft_buttonm" value="Haggle">';
   html += '               <input name="Submit"  style="background: url(' + x54_root + '/images/nag_pft_btn.gif) no-repeat; outline: none;"  type="submit" class="submit_ft_buttonm" onclick="location.reload()" value="Close"> ';
   html += '             </div> ';
   html += ' 			</form>';
   html += '           </div> ';
   if(document.URL.indexOf("http://www.tactics.com") != -1)
   	html += '           <div class="nag_haggle_cntrgt fr" align="center" style="height: 50px; width: 37px;">';
   else 
   	html += '           <div class="nag_haggle_cntrgt fr" align="center">';
   html += '           <img src="'+ x54_root + 'images/nagp_haggleimg.gif" alt="tag" width="37" height="84"><br> ';
   html += '           </div> ';
   html += '         </div>';

  html += '      </div>';
  html += '      <!--footer-->';
//html += '<br/><div id="showOffer" style="border: 1px solid red;">Arun Vaish<div><br/>'
  html += '    </div>';
  html += '  </div>';
html += '<textarea id="x54clipboard" style="display: none" name="x54clipboard"></textarea>';
/*
html = '<div id="x54_haggletag_" onmousedown="x54roi.beginrect(event,this,\'x54_haggletag_\',\'x54_roipanel_\')">';
html += '</div>';
html += '<img id="x54topmsg" src="http://www.nethaggler.com/images/drawrect_nag.gif" />';
html += '<div id="x54_roipanel_" onmousemove="x54roi.setCursor(event,this)" onmousedown="x54roi.beginrect(event,this,\'x54_haggletag_\',\'x54_roipanel_\')"></div>';
html += '<div id="x54dialog" style="display:none">';
html += '<table id="x54dialogpanel" border="0" cellpadding="0" cellspacing="0">';
html += '<tr>';
html += '<td id="x54titlebar" onmousedown="x54dlg.begindmove(event)">';
html += '<table width="100%" cellpadding="2" border="0"  cellspacing="0" >';
html += '<tr>';
html += '<td width="504">&nbsp;&nbsp;<img src="' + x54_root + 'images/New_logo.gif" alt="HaggleBox" /></td>';
html += '<!--NetHaggler-->';
html += '<td width="26">';
html += '<img id="x54closex" src="' + x54_root + 'images/close.jpg" alt="close" name="x54closex" onmousedown="location.reload()" />';
html += '</td></tr></table>';
html += ' </td></tr><tr>';
html += '<tr><td id="x54title"></td><tr>';
html += '<td id="x54productpanel">';
html += '<table id="x54content"  cellpadding="4" cellspacing="4">';
html += '<tr id="x54prodinfo">';
html += '<td id="x54prodimgpanel">';
html += '<img id="x54prod_img" src="http://www.nethaggler.com/images/noimage.gif"></td>';
html += '<td id="x54proddescpanel"><div id="x54prod_title">Title</div>';
html += '<div id="x54prod_desc">Description</div>';
html += '<div id="x54prod_curprice">$ 000.00</div></td>';
html += '<td><div id="x54ajaxloader" style="padding-top: 20px; vertical-align: middle; text-align: center;">';
html += '<img src="http://www.nethaggler.com/images/ajaxloader.gif"></div></td>';
html += '</tr></table></td></tr>';
html += '<tr><td id="x54tabbar"><span class="x54tabselect" id="x54tag">Tag</span>';
html += '<span class="x54tabsep"></span>';
html += '<span  class="x54tabunselect" style="display:none" id="x54nag">Nag</span>';
html += '<span class="x54tabsep"></span>';
html += '<span class="x54tabunselect" id="x54haggle">Haggle</span>';
html += '<span class="x54tabsep" style="WIDTH:302px"></span></td></tr>';
html += '<tr><td class="x54inputpanel">';
html += '<table border="0" cellpadding="0" cellspacing="0">';
html += '<tr><td>';
html += '<div id="x54tagpanel"  style="display: block"><form id="x54tagform">';
html += '<table border="0" cellpadding="0" cellspacing="0" id="x54taginput" style="border-top:0px"><tr>';
html += '<td colspan="4" height="8px"></td>';
html += '<td width="43" rowspan="6" bgcolor="#A4CD2F"><img src="'+ x54_root + 'images/tagleftimg.jpg" alt="NAG" width="41" height="143" /></td></tr>';
html += '<tr><td colspan="4" class="x54tagline">Tag the item for price watch</td></tr>';
html += '<tr><td width="90" class="x54label">Tag Price:</td><td width="180" class="x54input1">';
html += '<input class="xcl54_price" id="x54tag_price" type="text" name="x54tag_price"></td>';
html += '<td width="96" class="x54label">Quantity:</td>';
html += '<td width="105" class="x54input2"><input class="xcl54_quantity" value="1" id="x54tag_quantity" type="text" name="x54tag_quantity" /></td></tr>';
html += '<tr><td class="x54label">Email:</td>';
html += '<td class="x54input1"><input class="xcl54_email" id="x54tag_email" type="text" name="x54tag_email"></td>';
html += '<td class="x54label" id="x54tag_passcap">Password:</td>';
html += '<td class="x54input2"><input class="xcl54_password" id="x54tag_password" type="password" name="x54tag_password" /></td></tr>';
html += '<tr><td colspan="4" height="8px"></td></tr>';
html += '<tr><td colspan="4" class="x54statusbar"><table width="480" cellpadding="0" cellspacing="3" >';
html += '<tr> <td class="x54msg" id="x54tagmsg">&nbsp;</td>';
html += '<td><img src="'+ x54_root + 'images/save_btn.jpg" alt="Save" onclick="x54dlg.saveTag();" title="Save" />';
html += '<!--input type="submit" style="width: 60px;" value="Tag" id="Submit1" name="Submit1" /--></td>';
html += '<td><img src="'+ x54_root + 'images/close_btn.jpg" alt="Close" title="Close" onclick="location.reload()"/>';
html += '<!--input type="button" style="width: 60px;" value="Close"  id="Button1" onclick="location.reload()" name="Button1" /--></td></tr>';
html += '</table></td></tr> </table></form><div>';
html += '</tr></td><tr><td>';
html += '<div id="x54nagpanel" style="display: none;"><form id="x54nagform">';
html += '<input id="nag_discount" type="hidden" value="-1">';
html += '<table border="0" cellpadding="0" cellspacing="0" id="x54naginput" style="border-top:0px">';
html += '<tr><td height="8" colspan="4"></td>';
html += '<td width="43" rowspan="6" bgcolor="#A4CD2F"><img src="'+ x54_root + 'images/nagleftim1g.jpg" alt="NAG" width="43" height="148" /></td></tr>';
html += '<tr><td width="500" class="x54label">Offer Price:</td><td width="180" class="x54input1">';
html += '<input class="xcl54_price" id="x54nag_price" type="text" name="x54nag_price"></td>';
html += '<td width="127" class="x54label">Quantity:</td>';
html += '<td width="108" class="x54input2"><input class="xcl54_quantity" value="1" id="x54nag_quantity" type="text" name="x54nag_quantity" /> ';
html += '</td></tr>';
html += '<tr><td class="x54label">Reasons requesting for discount:</td>';
html += '<td class="x54input1" colspan=3><textarea class="xcl54_message" id="x54nag_message" name="x54nag_message"></textarea></td>';
html += '<!--td class="x54label"><span style="display:none">Offer Valid Till (mm/dd/yy):</span></td>';
html += '<td class="x54input2"><input class="xcl54_expires" style="display:none;" id="x54nag_expires" type="text" name="x54nag_expires" /></td--></tr>';
html += '<tr><td class="x54label">Email:</td>';
html += '<td class="x54input1"><input class="xcl54_email" id="x54nag_email" type="text" name="x54nag_email"></td>';
html += '<td class="x54label" id="x54nag_passcap">Password:</td>';
html += '<td class="x54input2"><input class="xcl54_password" id="x54nag_password" type="password" name="x54nag_password" /></td>';
html += '</tr><tr><td height="8" colspan="4"></td></tr>';
html += '<tr><td colspan="4" class="x54statusbar"><table cellpadding="0" cellspacing="3" >';
html += '<tr><td class="x54msg" id="x54nagmsg">&nbsp;</td>';
html += '<td><!--input type="submit" style="width: 60px;" value="Nag" id="Submit2" name="Submit2" /-->';
html += '<img src="'+ x54_root + 'images/nag_btn.jpg" alt="NAG" width="96" onclick="x54dlg.saveTag();" height="27" /> </td>';
html += '<td><!--input type="button" style="width: 60px;" value="Close" onclick="location.reload()" id="Button2" name="Button2" /-->';
html += '<img src="'+ x54_root + 'images/close_btn.jpg" name="Button2" onclick="location.reload()" id="Button2" alt="Close" title="Close" width="92" height="25" /> </td>';
html += '</tr></table></td></tr></table></form></div>';
html += '</tr></td><tr><td>';
html += '<div id="x54hagglepanel" style="display: none;"><form id="x54haggleform">';
html += '<table width="100%" border="0" cellpadding="0" cellspacing="0" id="x54haggleinput" style="border-top:0px"><tr>';
html += '<td colspan="4" class="x54tagline">Haggle collectively with other NetHagglers</td>';
html += '<td width="42" rowspan="5" bgcolor="#A4CD2F"><img src="'+ x54_root + 'images/haggle_tab.jpg" alt="" width="42" height="230" /></td></tr>';
html += '<tr><td colspan="4"><table width="480" >';
html += '<tr><td width="40%" valign="top">';
html += '<fieldset><legend align="left" class="x54legend"><strong>Offer Price</strong>&nbsp;</legend>';
html += '<table width="80%" border="0" cellpadding="2" cellspacing="2" ><tr>';
html += '<td class="x54label">Lowest:</td>';
html += '<td class="x54legend" id="x54haggle_lowest"> $0.00</td></tr>';
html += '<tr><td class="x54label">Median:</td><td class="x54legend" id="x54haggle_median"> $0.00</td></tr>';
html += '<tr><td class="x54label">Highest:</td><td class="x54legend" id="x54haggle_highest"> $0.00</td></tr></table>';
html += '</fieldset></td>';
html += '<td width="60%"><fieldset><legend align="left" class="x54legend"><strong>Sign Up</strong>&nbsp;</legend>';
html += '<table width="100%" border="0" align="right" cellpadding="0" cellspacing="0" ><tr>';
html += '<td width="54%" class="x54label">Minimum Required:</td>';
html += '<td width="46%" height="20" class="x54legend" id="x54haggle_threshold"><input class="xcl54_price" id="x54nag_price4" type="text" name="x54nag_price4" /></td></tr>';
html += '<tr><td class="x54label">Active Signup:</td>';
html += '<td height="20" class="x54legend" id="x54haggle_current"><input class="xcl54_price" id="x54nag_price42" type="text" name="x54nag_price42" /></td></tr>';
html += '<tr><td class="x54label">Signup Needed:</td>';
html += '<td height="20" class="x54legend" id="x54haggle_required"><input class="xcl54_price" id="x54nag_price43" type="text" name="x54nag_price43" /></td></tr>';
html += '</table></fieldset></td></tr></table></td> </tr><tr>';
html += '<td width="104" class="x54label">Your Offer:</td>';
html += '<td width="180" ><input class="xcl54_price" id="x54haggle_price" type="text" name="x54haggle_price" /></td>';
html += '<td width="86" class="x54label">Quantity:</td>';
html += '<td width="110" ><input class="xcl54_quantity" value="1" id="x54haggle_quantity" type="text" name="x54haggle_quantity" /></td></tr>';
html += '<tr><td class="x54label">Email:</td><td ><input class="xcl54_email" id="x54haggle_email" type="text" name="x54haggle_email" /></td>';
html += '<td class="x54label" id="x54haggle_passcap">Password:</td>';
html += '<td ><input class="xcl54_password" id="x54haggle_password" type="password" name="x54haggle_password" /></td></tr>';
html += '<tr><td colspan="4" class="x54statusbar"><table cellpadding="0" cellspacing="3" >';
html += '<tr><td class="x54msg" id="x54hagglemsg">&nbsp;</td><td><!--input type="submit" style="width: 60px;" value="Haggle" id="Submit3" name="Submit3"-->';
html += '<img src="'+ x54_root + 'images/haggle_btn.jpg" alt="Haggle" title="Haggle" onclick="x54dlg.saveTag();" width="95" height="25" /> </td>';
html += '<td><!--input type="button" style="width: 60px;" value="Close" onclick="location.reload()" id="Button3" name="Button3"-->';
html += '<img src="'+ x54_root + 'images/close_btn.jpg" alt="Close" title="Close" width="92" height="25" onclick="location.reload()" id="Button3" name="Button3" /> </td>';
html += '</tr></table></td></tr></table></form></div>';
html += '</tr></td></table>';
html += '</td></tr></table></div>';
html += '<textarea id="x54clipboard" style="display: none" name="x54clipboard"></textarea>';
*/
var x54dom = {
    offsetX: 0,
    offsetY: 0,
    initDone: false,
    setOffsetXY: function(x,y) {
        x54dom.offsetX = x;
        x54dom.offsetY = y;
        x54dom.initDone = true;
    },
    $: function(el) {
        return typeof el === "string" ? document.getElementById(el) : el;
    },
    
    def: function(el) {
        return typeof el !== "undefined";
    },
    spos: function() {
        var x=0,y=0,d=document,w=window;
        if( typeof( w.pageYOffset ) === 'number' ) {
            y = w.pageYOffset;
            x = w.pageXOffset;
        } else if( d.body && ( d.body.scrollLeft || d.body.scrollTop ) ) {
            y = d.body.scrollTop;
            x = d.body.scrollLeft;
        } else if( d.documentElement && ( d.documentElement.scrollLeft || d.documentElement.scrollTop ) ) {
            y = d.documentElement.scrollTop;
            x = d.documentElement.scrollLeft;
        }
        return {x:x,y:y};
    },
    clientsize: function() {
      var w=0,h=0,d=document,win=window;
      if(win.innerWidth && win.innerHeight) {
        w=win.innerWidth;
        h=win.innerHeight;
      } else if((!d.compatMode || d.compatMode == 'CSS1Compat') && !w.opera && d.documentElement && d.documentElement.clientHeight) {
        w=d.documentElement.clientWidth;
        h=d.documentElement.clientHeight;
      } else if(d.body && d.body.clientHeight) {
        w=d.body.clientWidth;
        h=d.body.clientHeight;
      }
      return {w:w-20,h:h-20};
    },
    docsize: function() {
      var b=document.body, e=document.documentElement;
      var esw=0, eow=0, bsw=0, bow=0, esh=0, eoh=0, bsh=0, boh=0;
      if (e) {
        esw = e.scrollWidth;
        eow = e.offsetWidth;
        esh = e.scrollHeight;
        eoh = e.offsetHeight;
      }
      if (b) {
        bsw = b.scrollWidth;
        bow = b.offsetWidth;
        bsh = b.scrollHeight;
        boh = b.offsetHeight;
      }
      return {w:Math.max(esw,eow,bsw,bow)-20,h:Math.max(esh,eoh,bsh,boh)-20};
    },
    pos: function(e) {
        var xy = {x:0, y:0};
        while(e) {
            if (x54dom.def(e.offsetLeft)) {
                xy.x += e.offsetLeft;
                xy.y += e.offsetTop;
            }
            e = e.offsetParent;
        }
        return xy;
    },

    event: function (e) {
        e = e || window.event;
        var evt = {target:null, pageX:0, pageY:0, offsetX:0, offsetY:0};
        evt.target = e.target || e.srcElement;
        var sp, pos;
        if (x54dom.def(e.pageX)) {
            evt.pageX = e.pageX - x54dom.offsetX;
            evt.pageY = e.pageY - x54dom.offsetY;
        } else if(x54dom.def(e.clientX)) {
            sp = x54dom.spos();
            evt.pageX = e.clientX + sp.x - x54dom.offsetX;
            evt.pageY = e.clientY + sp.y - x54dom.offsetY;
        }
        
        if(x54dom.def(e.offsetX)) {
            evt.offsetX = e.offsetX;
            evt.offsetY = e.offsetY;
        } else if(x54dom.def(e.layerX)) {
            evt.offsetX = e.layerX;
            evt.offsetY = e.layerY;
        } else {
            pos = x54dom.xy(evt.target);
            evt.offsetX = evt.pageX - pos.x;
            evt.offsetY = evt.pageY - pos.y;
        }
        evt.shiftKey = e.shiftKey; evt.ctrlKey = e.ctrlKey; evt.altKey = e.altKey;
        return evt;
    },
    
    stopEvent: function(e){
        e = e || window.event;
	    e.cancelBubble = true;
	    e.returnValue = false;
	    if (e.stopPropagation) {e.stopPropagation();}
	    if (e.preventDefault) {e.preventDefault();}
    },
    
	getbox: function(elem){
		var xy = x54dom.pos(elem);
		return {x:xy.x, y:xy.y, w:elem.offsetWidth, h:elem.offsetHeight};
	},
	
	intersect: function(a, b){
		var box = {l:Math.max(a.x,b.x), t:Math.max(a.y,b.y), r:Math.min(a.x+a.w,b.x+b.w), b:Math.min(a.y+a.h,b.y+b.h)};
		return (box.r > box.l &&  box.b > box.t) ? {x:box.l, y:box.t, w:box.r-box.l, h:box.b-box.t} : null;
	},
	
	copy: function(box, text) {
	    var clip = x54dom.$(box);
	    clip.value = text;
	    var range = clip.createTextRange();
	    range.execCommand("Copy");
	},
	camelCase: function(s){
		return s.replace(/-\D/g, function(match){
			return match.charAt(1).toUpperCase();
		});
	},
	css: function(e, p, i){
        var s, v=null, dv=document.defaultView;
        e=x54dom.$(e);
        if (e) {
            if(dv && dv.getComputedStyle){  
                s = dv.getComputedStyle(e,'');
                if (s) {v = s.getPropertyValue(p);}
            } else if(e.currentStyle) {
                v = e.currentStyle[x54dom.camelCase(p)];
            }
        }
        return i ? (parseInt(v,10) || 0) : v;
    },

	obj2str: function(obj) {
	    var txt = "";
	    for (var e in obj){
		    txt += e + ":" + obj[e] + "\n";
	    }
	    return txt;
    }	
};

var x54htm = {
   
//    unsupported: '<div id="x54_unsupported_" style="left:0px;top:0px;display:block;visibility:visible;width:360px;position:absolute;z-index:99999;padding:10px 4px 10px 4px;border:2px solid orange;background-color:rgb(252,251,131);color:black;text-align:left;vertical-align:middle;font-family:verdana;font-size:12px;font-weight:normal"><img src="http://www.nethaggler.com/images/error.gif" style="float:left"> Sorry, this site is not a NetHaggler-supported store. We are adding new stores every week. Please check back often.<p><input style="color:black;margin:4px 4px 4px 40px;padding:4px 0 4px 0;font-family:verdana;font-size:11px;" type="button" onclick="window.location=\'http://server3.nethaggler.com/home/logo.jsp\'" value="View Supported Stores" >&nbsp;&nbsp;<input style="color:black;margin:4px;padding:4px 0 4px 0; font-family:verdana;font-size:11px;" type="button" onclick="location.reload()" value="Close" ></p></div>',
    unsupported:'<div id="x54_unsupported_" style="left:0px;top:0px;display:block;visibility:visible;width:360px;position:absolute;z-index:99999;padding:10px 4px 10px 4px;border:1px solid #859364;background:url(http://www.nethaggler.com/home/images/bg_box.gif) repeat-x bottom left;color:black;text-align:left;vertical-align:middle;font-family:verdana;font-size:12px;font-weight:normal"><img src="http://www.nethaggler.com/home/images/errror.gif" width="38" height="39" style="float:left"> Sorry, this site is not a NetHaggler-supported store. We are adding new stores every week. Please check back often.<p><input style="color:black;margin:4px 4px 4px 40px;padding:4px 0 4px 0;font-family:verdana;font-size:11px;" type="button" onclick="window.location=\'http://www.nethaggler.com/home/logo.jsp\'" value="View Supported Stores" >&nbsp;&nbsp;<input style="color:black;margin:4px;padding:4px 0 4px 0; font-family:verdana;font-size:11px;" type="button" onclick="location.reload()" value="Close" ></p></div>',
    //haggletag: '<div id="x54_haggletag_" onmousedown="x54roi.beginrect(event,this,\'x54_haggletag_\',\'x54_roipanel_\')"></div><img id="x54topmsg" src="http://www.nethaggler.com/images/drawrect.gif" /><div id="x54_roipanel_" onmousemove="x54roi.setCursor(event,this)" onmousedown="x54roi.beginrect(event,this,\'x54_haggletag_\',\'x54_roipanel_\')"></div><div id="x54dialog" style="display:none"><table id="x54dialogpanel" cellpadding="0" cellspacing="0"><tr><td id="x54titlebar" onmousedown="x54dlg.begindmove(event)"><table cellpadding="2" cellspacing="0" ><tr><td id="x54title">NetHaggler</td><td><input id="x54closex" type="button" onmousedown="location.reload()" value=" x " name="x54closex"></td></tr></table></td></tr><tr><td id="x54productpanel"><table id="x54content" cellpadding="4" cellspacing="4"><tr id="x54prodinfo"><td id="x54prodimgpanel"><img id="x54prod_img" src="http://www.nethaggler.com/images/noimage.gif"></td><td id="x54proddescpanel"><div id="x54prod_title"></div><div id="x54prod_desc"></div><div id="x54prod_curprice"></div></td><td><div id="x54ajaxloader" style="padding-top: 20px; vertical-align: middle; text-align: center;"><img src="http://www.nethaggler.com/images/ajaxloader.gif"></div></td></tr></table></td></tr><tr><td id="x54tabbar"><span class="x54tabcom" id="x54tag">Tag</span><span class="x54tabcom" style="margin: 0 2px 0 2px" id="x54nag">Nag</span><span class="x54tabcom" id="x54haggle">Haggle</span></td></tr><tr id="x54tagpanel" style="display: none"><td class="x54inputpanel"><form id="x54tagform" style="display: inline" onsubmit="x54dlg.saveTag();return false;"><table id="x54taginput" cellpadding="0" cellspacing="4"><tr><td colspan="4" class="x54tagline">Tag the item for price watch</td></tr><tr><td class="x54label">Tag Price:</td><td class="x54input1"><input class="xcl54_price" id="x54tag_price" type="text" name="x54tag_price"></td><td class="x54label">Quantity:</td><td class="x54input2"><input class="xcl54_quantity" value="1" id="x54tag_quantity" type="text" name="x54tag_quantity"></td></tr><tr><td class="x54label">Email:</td><td class="x54input1"><input class="xcl54_email" id="x54tag_email" type="text" name="x54tag_email"></td><td class="x54label" id="x54tag_passcap">Password:</td><td class="x54input2"><input class="xcl54_password" id="x54tag_password" type="password" name="x54tag_password"></td></tr><tr><td colspan="4" class="x54note">Note: You are not obligated to buy</td></tr><tr><td colspan="4" class="x54statusbar"><table cellpadding="0" cellspacing="3" ><tr><td class="x54msg" id="x54tagmsg">&nbsp;</td><td><input type="submit" style="width: 60px;" value="Tag" id="Submit1" name="Submit1"></td><td><input type="button" style="width: 60px;" value="Close" onclick="location.reload()" id="Button1" name="Button1"></td></tr></table></td></tr></table></form></td></tr><tr id="x54nagpanel" style="display: none"><td class="x54inputpanel"><form id="x54nagform" style="display: inline" onsubmit="x54dlg.saveTag();return false;"><table id="x54naginput" cellpadding="0" cellspacing="4"><tr><td colspan="4" class="x54tagline">Nag the merchant for a lower price</td></tr><tr><td class="x54label">Offer Price:</td><td class="x54input1"><input class="xcl54_price" id="x54nag_price" type="text" name="x54nag_price"></td><td class="x54label">Quantity:</td><td class="x54input2"><input class="xcl54_quantity" value="1" id="x54nag_quantity" type="text" name="x54nag_quantity"></td></tr><tr><td class="x54label">Message to Vendor:</td><td class="x54input1"><textarea class="xcl54_message" id="x54nag_message" name="x54nag_message"></textarea></td><td class="x54label">Offer Valid Till (mm/dd/yy):</td><td class="x54input2"><input class="xcl54_expires" id="x54nag_expires" type="text" name="x54nag_expires"></td></tr><tr><td class="x54label">Email:</td><td class="x54input1"><input class="xcl54_email" id="x54nag_email" type="text" name="x54nag_email"></td><td class="x54label" id="x54nag_passcap">Password:</td><td class="x54input2"><input class="xcl54_password" id="x54nag_password" type="password" name="x54nag_password"></td></tr><tr><td colspan="4" class="x54note">Note: You are not obligated to buy</td></tr><tr><td colspan="4" class="x54statusbar"><table cellpadding="0" cellspacing="3" ><tr><td class="x54msg" id="x54nagmsg">&nbsp;</td><td><input type="submit" style="width: 60px;" value="Nag" id="Submit2" name="Submit2"></td><td><input type="button" style="width: 60px;" value="Close" onclick="location.reload()" id="Button2" name="Button2"></td></tr></table></td></tr><tr id="x54alpharow" style="display: none"><td colspan="4" class="x54alphamsg">Note: NetHaggler is currently automating the Nag platform. In the meantime we will try to convey your Nag request manually to the merchant. Irrespective of the merchant\'s response, you will receive alerts when the price falls below your offer price. We regret any inconvenience as we automate the platform.</td></tr></table></form></td></tr><tr id="x54hagglepanel" style="display: none"><td class="x54inputpanel"><form id="x54haggleform" style="display: inline" onsubmit="x54dlg.saveTag();return false;"><table id="x54haggleinput" cellpadding="0" cellspacing="4"><tr><td colspan="4" class="x54tagline">Haggle collectively with other NetHagglers</td></tr><tr><td colspan="4"><table width="100%" ><tr><td><fieldset><legend align="center" class="x54legend">Offer Price&nbsp;</legend><table ><tr><td class="x54label">Lowest:</td><td class="x54legend" id="x54haggle_lowest">n/a</td></tr><tr><td class="x54label">Median:</td><td class="x54legend" id="x54haggle_median">n/a</td></tr><tr><td class="x54label">Highest:</td><td class="x54legend" id="x54haggle_highest">n/a</td></tr></table></fieldset></td><td><fieldset><legend align="center" class="x54legend">Offer Counts&nbsp;</legend><table ><tr><td class="x54label">Minimum Required:</td><td class="x54legend" id="x54haggle_threshold">100</td></tr><tr><td class="x54label">Active Offers:</td><td class="x54legend" id="x54haggle_current">0</td></tr><tr><td class="x54label">Offers Needed:</td><td class="x54legend" id="x54haggle_required">100</td></tr></table></fieldset></td></tr></table></td></tr><tr><td class="x54label">Offer Price:</td><td class="x54input1"><input class="xcl54_price" id="x54haggle_price" type="text" name="x54haggle_price"></td><td class="x54label">Quantity:</td><td class="x54input2"><input class="xcl54_quantity" value="1" id="x54haggle_quantity" type="text" name="x54haggle_quantity"></td></tr><tr><td class="x54label">Email:</td><td class="x54input1"><input class="xcl54_email" id="x54haggle_email" type="text" name="x54haggle_email"></td><td class="x54label" id="x54haggle_passcap">Password:</td><td class="x54input2"><input class="xcl54_password" id="x54haggle_password" type="password" name="x54haggle_password"></td></tr><tr><td colspan="4" class="x54note">Note: You are not obligated to buy</td></tr><tr><td colspan="4" class="x54statusbar"><table cellpadding="0" cellspacing="3" ><tr><td class="x54msg" id="x54hagglemsg">&nbsp;</td><td><input type="submit" style="width: 60px;" value="Haggle" id="Submit3" name="Submit3"></td><td><input type="button" style="width: 60px;" value="Close" onclick="location.reload()" id="Button3" name="Button3"></td></tr></table></td></tr></table></form></td></tr></table></div><textarea id="x54clipboard" style="display: none" name="x54clipboard"></textarea>',
	haggletag: html,
	    createElement: function(tag) {
	    return typeof document.standardCreateElement !== 'undefined' ? 
	      document.standardCreateElement(tag) : document.createElement(tag);
    },
    includeScript: function (src, id) {
        var objHead,objScript;
	    if (!document.getElementById(id)) {
		    objHead = document.getElementsByTagName('head');
		    if (objHead[0]) {
			    objScript = objHead[0].appendChild(x54htm.createElement('script'));
			    objScript.id = id;
			    objScript.type = 'text/javascript';
			    objScript.src = src;
		    }
	    }
    },
    includeCSS: function (src, id) {
        var objHead,objCSS;
	    if (!document.getElementById(id)) {
		    objHead = document.getElementsByTagName('head');
		    if (objHead[0]) {
			    if (document.createElementNS && objHead[0].tagName == 'head') {
				    objCSS = document.createElementNS('http://www.w3.org/1999/xhtml', 'link');
			    } else {
				    objCSS = x54htm.createElement('link');
			    } 
			    objCSS = objHead[0].appendChild(objCSS);
			    objCSS.id = id;
			    objCSS.type = 'text/css';
			    objCSS.rel = 'stylesheet';
			    objCSS.href = src;
		    }
	    }			
   }, 
    init: function(){
	    var d=document,w=window;
	    var tags = ["object","embed","applet","select"];
	    var tag,wins,i;
	    for (tag in tags){
		    wins = d.getElementsByTagName(tags[tag]);
		    for (i=0; i < wins.length; i++) {
			    wins[i].style.visibility="hidden";
		    }
	    }	

       if (typeof w.x54_which === "undefined")
       {
       		w.x54_which = "x54tag";
       }
       if (typeof w.x54_root === "undefined"){w.x54_root = x54_default_root;}
        x54htm.includeScript(x54_root + "x54store.jsp?uri=" + escape(d.URL) + "&callback=x54htm.onstore", "x54store");
      
        
	 },
	 
   onstore: function(resp){
   
      var d=document,w=window,store,div,undiv,docsize,hts,tms,spos = x54dom.spos();
         div = d.getElementById("x54_haggletag_");
         undiv = d.getElementById("x54_unsupported_");
	  //alert(resp.supported);
	   if (resp.supported == "true") 
	   {
	     store = d.URL.split(".")[1].toLowerCase();
         if (!div) {
            x54htm.includeCSS(x54_root + 'x54style.css', 'x54stylecss');
            if (x54_root !== x54_default_root) {
               x54htm.haggletag = x54htm.haggletag.replace(/http:\/\/www\.nethaggler\.com\//g, x54_root);
            }
            div = x54htm.createElement("div");
            div.style.display="inline";
            div = d.body.appendChild(div);
            div.innerHTML = x54htm.haggletag;
				
			if(resp.nag_support == "true") 
		     {
		     	var imgPath = "http://www.nethaggler.com/images/drawrect.gif";
		     	imgPath = imgPath.replace(/http:\/\/www\.nethaggler\.com\//g, x54_root)
		     	x54dom.$("x54topmsg").src = imgPath;
		     	x54dom.$("nag_discount").value = resp.nag_discount;
		     	nagFailureFlag=false;
			 }
			 else
			 {
			    nagFailureFlag=true;
			 	x54dom.$("x54nag_save").disabled = true;
			 }
		    docsize = x54dom.docsize();
            hts = x54dom.$("x54_haggletag_").style;
            hts.display = "block";
            hts.width = docsize.w + "px";
            hts.height = docsize.h + "px";

            tms = x54dom.$("x54topmsg").style;
            tms.display = "block";
            tms.left = spos.x + "px";
            tms.top = spos.y + "px";

            x54htm.includeScript(x54_root + 'scripts/x54ui.js', 'x54uijs');
         }
      } else if (!undiv) {
         if (x54_root !== x54_default_root) {
            x54htm.unsupported = x54htm.unsupported.replace(/http:\/\/www\.nethaggler\.com\//g, x54_root);
         }
         undiv = x54htm.createElement("DIV");
         undiv = d.body.appendChild(undiv);
         undiv.innerHTML = x54htm.unsupported;
         tms = x54dom.$("x54_unsupported_").style;
         tms.left = spos.x + "px";
         tms.top = spos.y + "px";
      }
   }
};


x54htm.init();