//INITIATE GLOBAL VARS
var URL = "http://www.worldincatalog.com";
/************************************************************************************************************
***********************************************DROP MENU LINK************************************************
************************************************************************************************************/


/******************************DROP DOWN MENU******************************/

//Contents for menu 1
var menu1=new Array()
menu1[0]='<a href="'+URL+'/manage/?pg=store" onClick="return getLinkContent(this);">View My Items</a>'
menu1[1]='<a href="'+URL+'/manage/?pg=sold" onClick="return getLinkContent(this);">View Sold Items</a>'
menu1[2]='<a href="'+URL+'/manage/?pg=bot" onClick="return getLinkContent(this);">View Purchases</a>'
menu1[3]='<a href="'+URL+'/manage/?pg=account" onClick="return getLinkContent(this);">My Account</a>'
menu1[4]='<a href="'+URL+'/manage/?pg=password" onClick="return getLinkContent(this);">Change Password</a>'
 

//SETTINGS/CONFIGURATION		
var menuwidth='80px' //default menu width
var menubgcolor='lightyellow'  //menu bgcolor
var disappeardelay=200  //menu disappear speed onMouseout (in miliseconds)
var hidemenu_onclick="yes" //hide menu when user clicks within menu?

//////////////////////////////////////////////////////////////////////

var ie4=document.all
var ns6=document.getElementById&&!document.all

if (ie4||ns6)
document.write('<div id="dropmenudiv" style="visibility:hidden;width:'+menuwidth+';background-color:'+menubgcolor+'" onMouseover="clearhidemenu()" onMouseout="dynamichide(event)"></div>')

function getposOffset(what, offsettype){
var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
var parentEl=what.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
}


function showhide(obj, e, visible, hidden, menuwidth){
if (ie4||ns6)
dropmenuobj.style.left=dropmenuobj.style.top="-500px"
if (menuwidth!=""){
dropmenuobj.widthobj=dropmenuobj.style
dropmenuobj.widthobj.width=menuwidth
}
if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover")
obj.visibility=visible
else if (e.type=="click")
obj.visibility=hidden
}

function iecompattest(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function clearbrowseredge(obj, whichedge){
var edgeoffset=0
if (whichedge=="rightedge"){
var windowedge=ie4 && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15
dropmenuobj.contentmeasure=dropmenuobj.offsetWidth
if (windowedge-dropmenuobj.x < dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure-obj.offsetWidth
}
else{
var topedge=ie4 && !window.opera? iecompattest().scrollTop : window.pageYOffset
var windowedge=ie4 && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
dropmenuobj.contentmeasure=dropmenuobj.offsetHeight
if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure){ //move up?
edgeoffset=dropmenuobj.contentmeasure+obj.offsetHeight
if ((dropmenuobj.y-topedge)<dropmenuobj.contentmeasure) //up no good either?
edgeoffset=dropmenuobj.y+obj.offsetHeight-topedge
}
}
return edgeoffset
}

function populatemenu(what){
if (ie4||ns6)
dropmenuobj.innerHTML=what.join("")
}


function dropdownmenu(obj, e, menucontents, menuwidth){
if (window.event) event.cancelBubble=true
else if (e.stopPropagation) e.stopPropagation()
clearhidemenu()
dropmenuobj=document.getElementById? document.getElementById("dropmenudiv") : dropmenudiv
populatemenu(menucontents)

if (ie4||ns6){
showhide(dropmenuobj.style, e, "visible", "hidden", menuwidth)
dropmenuobj.x=getposOffset(obj, "left")
dropmenuobj.y=getposOffset(obj, "top")
dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+"px"
dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+"px"
}

return clickreturnvalue()
}

function clickreturnvalue(){
if (ie4||ns6) return false
else return true
}

function contains_ns6(a, b) {
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
}

function dynamichide(e){
if (ie4&&!dropmenuobj.contains(e.toElement))
delayhidemenu()
else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
delayhidemenu()
}

function hidemenu(e){
if (typeof dropmenuobj!="undefined"){
if (ie4||ns6)
dropmenuobj.style.visibility="hidden"
}
}

function delayhidemenu(){
if (ie4||ns6)
delayhide=setTimeout("hidemenu()",disappeardelay)
}

function clearhidemenu(){
if (typeof delayhide!="undefined")
clearTimeout(delayhide)
}

if (hidemenu_onclick=="yes")
document.onclick=hidemenu

/****************************END DROP DOWN MENU****************************/






/************************************************************************************************************
**********************************************ROUNDED CORNERS************************************************
************************************************************************************************************/


/************************************************************************************************************<br>
<br>
	@fileoverview
	Rounded corners class<br>
	(C) www.dhtmlgoodies.com, September 2006<br>
	<br>
	This is a script from www.dhtmlgoodies.com. You will find this and a lot of other scripts at our website.	<br>
	<br>
	Terms of use:<br>
	Look at the terms of use at http://www.dhtmlgoodies.com/index.html?page=termsOfUse<br>
	<br>
	Thank you!<br>
	<br>
	www.dhtmlgoodies.com<br>
	Alf Magne Kalleland<br>
<br>
************************************************************************************************************/

// {{{ Constructor
function RoundedCorners()
{
	var roundedCornerTargets;
	
	this.roundedCornerTargets = new Array();
	
}
	var string = '';
// }}}
RoundedCorners.prototype = {

	// {{{ addTarget() 
    /**
     *
	 *
     *  Add rounded corners to an element
     *
     *	@param String divId = Id of element on page. Example "leftColumn" for &lt;div id="leftColumn">
     *	@param Int xRadius = Y radius of rounded corners, example 10
     *	@param Int yRadius = Y radius of rounded corners, example 10
     *  @param String color = Background color of element, example #FFF or #AABBCC
     *  @param String color = backgroundColor color of element "behind", example #FFF or #AABBCC
     *  @param Int padding = Padding of content - This will be added as left and right padding(not top and bottom)
     *  @param String heightOfContent = Optional argument. You can specify a fixed height of your content. example "15" which means pixels, or "50%". 
     *  @param String whichCorners = Optional argument. Commaseparated list of corners, example "top_left,top_right,bottom_left"
     * 
     * @public
     */		
    addTarget : function(divId,xRadius,yRadius,color,backgroundColor,padding,heightOfContent,whichCorners)
    {	
    	var index = this.roundedCornerTargets.length;
    	this.roundedCornerTargets[index] = new Array();
    	this.roundedCornerTargets[index]['divId'] = divId;
    	this.roundedCornerTargets[index]['xRadius'] = xRadius;
    	this.roundedCornerTargets[index]['yRadius'] = yRadius;
    	this.roundedCornerTargets[index]['color'] = color;
    	this.roundedCornerTargets[index]['backgroundColor'] = backgroundColor;
    	this.roundedCornerTargets[index]['padding'] = padding;
    	this.roundedCornerTargets[index]['heightOfContent'] = heightOfContent;
    	this.roundedCornerTargets[index]['whichCorners'] = whichCorners;  
    	
    }
    // }}}
    ,
	// {{{ init()
    /**
     *
	 *
     *  Initializes the script
     *
     * 
     * @public
     */	    
	init : function()
	{
		
		for(var targetCounter=0;targetCounter < this.roundedCornerTargets.length;targetCounter++){
			
			// Creating local variables of each option
			whichCorners = this.roundedCornerTargets[targetCounter]['whichCorners'];
			divId = this.roundedCornerTargets[targetCounter]['divId'];
			xRadius = this.roundedCornerTargets[targetCounter]['xRadius'];
			yRadius = this.roundedCornerTargets[targetCounter]['yRadius'];
			color = this.roundedCornerTargets[targetCounter]['color'];
			backgroundColor = this.roundedCornerTargets[targetCounter]['backgroundColor'];
			padding = this.roundedCornerTargets[targetCounter]['padding'];
			heightOfContent = this.roundedCornerTargets[targetCounter]['heightOfContent'];
			whichCorners = this.roundedCornerTargets[targetCounter]['whichCorners'];

			// Which corners should we add rounded corners to?
			var cornerArray = new Array();
			if(!whichCorners || whichCorners=='all'){
				cornerArray['top_left'] = true;
				cornerArray['top_right'] = true;
				cornerArray['bottom_left'] = true;
				cornerArray['bottom_right'] = true;
			}else{
				cornerArray = whichCorners.split(/,/gi);
				for(var prop in cornerArray)cornerArray[cornerArray[prop]] = true;
			}
					
				
			var factorX = xRadius/yRadius;	// How big is x radius compared to y radius
		
			var obj = document.getElementById(divId);	// Creating reference to element
			obj.style.backgroundColor=null;	// Setting background color blank
			obj.style.backgroundColor='transparent';
			var content = obj.innerHTML;	// Saving HTML content of this element
			obj.innerHTML = '';	// Setting HTML content of element blank-
			
	
			
			
			// Adding top corner div.
			
			if(cornerArray['top_left'] || cornerArray['top_right']){
				var topBar_container = document.createElement('DIV');
				topBar_container.style.height = yRadius + 'px';
				topBar_container.style.overflow = 'hidden';	
		
				obj.appendChild(topBar_container);		
				var currentAntialiasSize = 0;
				var savedRestValue = 0;
				
				for(no=1;no<=yRadius;no++){
					var marginSize = (xRadius - (this.getY((yRadius - no),yRadius,factorX)));					
					var marginSize_decimals = (xRadius - (this.getY_withDecimals((yRadius - no),yRadius,factorX)));					
					var restValue = xRadius - marginSize_decimals;		
					var antialiasSize = xRadius - marginSize - Math.floor(savedRestValue)
					var foregroundSize = xRadius - (marginSize + antialiasSize);	
					
					var el = document.createElement('DIV');
					el.style.overflow='hidden';
					el.style.height = '1px';					
					if(cornerArray['top_left'])el.style.marginLeft = marginSize + 'px';				
					if(cornerArray['top_right'])el.style.marginRight = marginSize + 'px';	
					topBar_container.appendChild(el);				
					var y = topBar_container;		
					
					for(var no2=1;no2<=antialiasSize;no2++){
						switch(no2){
							case 1:
								if (no2 == antialiasSize)
									blendMode = ((restValue + savedRestValue) /2) - foregroundSize;
								else {
								  var tmpValue = this.getY_withDecimals((xRadius - marginSize - no2),xRadius,1/factorX);
								  blendMode = (restValue - foregroundSize - antialiasSize + 1) * (tmpValue - (yRadius - no)) /2;
								}						
								break;							
							case antialiasSize:								
								var tmpValue = this.getY_withDecimals((xRadius - marginSize - no2 + 1),xRadius,1/factorX);								
								blendMode = 1 - (1 - (tmpValue - (yRadius - no))) * (1 - (savedRestValue - foregroundSize)) /2;							
								break;
							default:			
								var tmpValue2 = this.getY_withDecimals((xRadius - marginSize - no2),xRadius,1/factorX);
								var tmpValue = this.getY_withDecimals((xRadius - marginSize - no2 + 1),xRadius,1/factorX);		
								blendMode = ((tmpValue + tmpValue2) / 2) - (yRadius - no);							
						}
						
						el.style.backgroundColor = this.__blendColors(backgroundColor,color,blendMode);
						y.appendChild(el);
						y = el;
						var el = document.createElement('DIV');
						el.style.height = '1px';	
						el.style.overflow='hidden';
						if(cornerArray['top_left'])el.style.marginLeft = '1px';
						if(cornerArray['top_right'])el.style.marginRight = '1px';    						
						el.style.backgroundColor=color;					
					}
					
					y.appendChild(el);				
					savedRestValue = restValue;
				}
			}
			
			// Add content
			var contentDiv = document.createElement('DIV');
			contentDiv.className = obj.className;
			contentDiv.style.border='1px solid ' + color;
			contentDiv.innerHTML = content;
			contentDiv.style.backgroundColor=color;
			contentDiv.style.paddingLeft = padding + 'px';
			contentDiv.style.paddingRight = padding + 'px';
	
			if(!heightOfContent)heightOfContent = '';
			heightOfContent = heightOfContent + '';
			if(heightOfContent.length>0 && heightOfContent.indexOf('%')==-1)heightOfContent = heightOfContent + 'px';
			if(heightOfContent.length>0)contentDiv.style.height = heightOfContent;
			
			obj.appendChild(contentDiv);
	
		
			if(cornerArray['bottom_left'] || cornerArray['bottom_right']){
				var bottomBar_container = document.createElement('DIV');
				bottomBar_container.style.height = yRadius + 'px';
				bottomBar_container.style.overflow = 'hidden';	
		
				obj.appendChild(bottomBar_container);		
				var currentAntialiasSize = 0;
				var savedRestValue = 0;
				
				var errorOccured = false;
				var arrayOfDivs = new Array();
				for(no=1;no<=yRadius;no++){
					
					var marginSize = (xRadius - (this.getY((yRadius - no),yRadius,factorX)));					
					var marginSize_decimals = (xRadius - (this.getY_withDecimals((yRadius - no),yRadius,factorX)));						
	
					var restValue = (xRadius - marginSize_decimals);				
					var antialiasSize = xRadius - marginSize - Math.floor(savedRestValue)
					var foregroundSize = xRadius - (marginSize + antialiasSize);	
					
					var el = document.createElement('DIV');
					el.style.overflow='hidden';
					el.style.height = '1px';					
					if(cornerArray['bottom_left'])el.style.marginLeft = marginSize + 'px';				
					if(cornerArray['bottom_right'])el.style.marginRight = marginSize + 'px';	
					bottomBar_container.insertBefore(el,bottomBar_container.firstChild);				
					
					var y = bottomBar_container;		
					
					for(var no2=1;no2<=antialiasSize;no2++){
						switch(no2){
							case 1:
								if (no2 == antialiasSize)
									blendMode = ((restValue + savedRestValue) /2) - foregroundSize;
								else {
								  var tmpValue = this.getY_withDecimals((xRadius - marginSize - no2),xRadius,1/factorX);
								  blendMode = (restValue - foregroundSize - antialiasSize + 1) * (tmpValue - (yRadius - no)) /2;
								}						
								break;							
							case antialiasSize:								
								var tmpValue = this.getY_withDecimals((xRadius - marginSize - no2 + 1),xRadius,1/factorX);								
								blendMode = 1 - (1 - (tmpValue - (yRadius - no))) * (1 - (savedRestValue - foregroundSize)) /2;							
								break;
							default:			
								var tmpValue2 = this.getY_withDecimals((xRadius - marginSize - no2),xRadius,1/factorX);
								var tmpValue = this.getY_withDecimals((xRadius - marginSize - no2 + 1),xRadius,1/factorX);		
								blendMode = ((tmpValue + tmpValue2) / 2) - (yRadius - no);							
						}
						
						el.style.backgroundColor = this.__blendColors(backgroundColor,color,blendMode);
						
						if(y==bottomBar_container)arrayOfDivs[arrayOfDivs.length] = el;
						
						try{	// Need to look closer at this problem which occures in Opera.
							var firstChild = y.getElementsByTagName('DIV')[0];
							y.insertBefore(el,y.firstChild);
						}catch(e){
							y.appendChild(el);							
							errorOccured = true;
						}
						y = el;
						
						var el = document.createElement('DIV');
						el.style.height = '1px';	
						el.style.overflow='hidden';
						if(cornerArray['bottom_left'])el.style.marginLeft = '1px';
						if(cornerArray['bottom_right'])el.style.marginRight = '1px';    						
										
					}
					
					if(errorOccured){	// Opera fix
						for(var divCounter=arrayOfDivs.length-1;divCounter>=0;divCounter--){
							bottomBar_container.appendChild(arrayOfDivs[divCounter]);
						}
					}
					
					el.style.backgroundColor=color;	
					y.appendChild(el);				
					savedRestValue = restValue;
				}
	
			}			
		}
	}		
	// }}}
	,		
	// {{{ getY()
    /**
     *
	 *
     *  Add rounded corners to an element
     *
     *	@param Int x = x Coordinate
     *	@param Int maxX = Size of rounded corners
	 *
     * 
     * @private
     */		
	getY : function(x,maxX,factorX){
		// y = sqrt(100 - x^2)			
		// Y = 0.5 * ((100 - x^2)^0.5);			
		return Math.max(0,Math.ceil(factorX * Math.sqrt( (maxX * maxX) - (x*x)) ));
		
	}	
	// }}}
	,		
	// {{{ getY_withDecimals()
    /**
     *
	 *
     *  Add rounded corners to an element
     *
     *	@param Int x = x Coordinate
     *	@param Int maxX = Size of rounded corners
	 *
     * 
     * @private
     */		
	getY_withDecimals : function(x,maxX,factorX){
		// y = sqrt(100 - x^2)			
		// Y = 0.5 * ((100 - x^2)^0.5);			
		return Math.max(0,factorX * Math.sqrt( (maxX * maxX) - (x*x)) );
		
	}
	

	,

	// {{{ __blendColors()
    /**
     *
	 *
     *  Simply blending two colors by extracting red, green and blue and subtracting difference between colors from them.
     * 	Finally, we multiply it with the blendMode value
     *
     *	@param String colorA = RGB color
     *	@param String colorB = RGB color
     *	@param Float blendMode 
	 *
     * 
     * @private
     */		
	__blendColors : function (colorA, colorB, blendMode) {
		if(colorA.length=='4'){	// In case we are dealing with colors like #FFF
			colorA = '#' + colorA.substring(1,1) + colorA.substring(1,1) + colorA.substring(2,1) + colorA.substring(2,1) + colorA.substring(3,1) + colorA.substring(3,1);
		}	
		if(colorB.length=='4'){	// In case we are dealing with colors like #FFF
			colorB = '#' + colorB.substring(1,1) + colorB.substring(1,1) + colorB.substring(2,1) + colorB.substring(2,1) + colorB.substring(3,1) + colorB.substring(3,1);
		}
		var colorArrayA = [parseInt('0x' + colorA.substring(1,3)), parseInt('0x' + colorA.substring(3, 5)), parseInt('0x' + colorA.substring(5, 7))];	// Create array of Red, Green and Blue ( 0-255)
		var colorArrayB = [parseInt('0x' + colorB.substring(1,3)), parseInt('0x' + colorB.substring(3, 5)), parseInt('0x' + colorB.substring(5, 7))];	// Create array of Red, Green and Blue ( 0-255)		
		var red = Math.round(colorArrayA[0] + (colorArrayB[0] - colorArrayA[0])*blendMode).toString(16);	// Create new Red color ( Hex )
		var green = Math.round(colorArrayA[1] + (colorArrayB[1] - colorArrayA[1])*blendMode).toString(16);	// Create new Green color ( Hex )
		var blue = Math.round(colorArrayA[2] + (colorArrayB[2] - colorArrayA[2])*blendMode).toString(16);	// Create new Blue color ( Hex )
		
		if(red.length==1)red = '0' + red;
		if(green.length==1)green = '0' + green;
		if(blue.length==1)blue = '0' + blue;
			
		return '#' + red + green+ blue;	// Return new RGB color
	}
}	



/**************** CROSS-BROWSER XML HTTP REQUEST AND XML PARSER ********************************
* CALL EXAMPLE: var loader = new xhr.ContentLoader('GET','index.html?id=1',true,handleResponse);
* HANDLER EXAMPLE:
function handleResponse(){
    alert("This page content: \n"+this.req.responseText);
}
***********************************************************************************************/

/*
Wrapper function for constructing a request object
  Parameters:
    method: POST or GET
    url: local URL
    asynch: true or false
    respHandle: function name to handle response
    5th element: parameters for POST method
*/
var xhr = new Object();
xhr.READY_STATE_UNINITIALIZED = 0;
xhr.READY_STATE_LOADING = 1;
xhr.READY_STATE_LOADED = 2;
xhr.READY_STATE_INTERACTIVE = 3;
xhr.READY_STATE_COMPLETE = 4;
xhr.ContentLoader = function(method,url,asynch,respHandle,params,onerror){
  this.method =         method;
  this.url =               url;
  this.asynch =         asynch; 
  this.respHandle = respHandle;
  this.params =         params; 
  this.onerror =         (onerror) ? onerror : this.defaultError;
  this.req =               null;
  this.loadXMLDoc(method,url,asynch,params);
}
xhr.ContentLoader.prototype = {
    loadXMLDoc:function(method,url,asynch,params){       
      //Mozilla-based browsers
      if(window.XMLHttpRequest){
          this.req = new XMLHttpRequest();
      //Internet Explorer
      }else if(window.ActiveXObject){
          this.req = new ActiveXObject("Msxml2.XMLHTTP");
          if(!this.req){
              this.req = new ActiveXObject("Microsoft.XMLHTTP");
          }
      }
      //test for null request
      if(this.req){
          if(method.toLowerCase() != "post"){
              this.initReq(method,url,asynch);
          }else{//POSTed data
              var args = arguments[3];
              if(args != null && args.length > 0){
                  this.initReq(method,url,asynch,args);
              }
          }
      }else{
          alert("Your browser does not permit the use of all "+
                "of this application's features!");
      }   
    },
    initReq:function(method,url,asynch,args){       
      try{
          //Specify the function which will handle HTTP response
          var loader = this;
          this.req.onreadystatechange = function(){                               
              loader.onReadyState.call(loader);
          }
          this.req.open(method,url,asynch);
          //POSTed data
          if(method.toLowerCase() == "post"){
              this.req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
              this.req.send(arguments[3]);   
          }else{
              this.req.send(null);
          }
      }catch (errv){
          alert("The application cannot contact the server at the moment. Error details: "+errv.message);
      }       
    },
    onReadyState:function(){
      var req = this.req;
      var ready = req.readyState;
      if(ready == xhr.READY_STATE_COMPLETE){       
           var httpStatus = req.status;
           if(httpStatus == 200 || httpStatus == 0){
               this.respHandle.call(this);              
           }else{
               this.onerror.call(this);
           }
      }
  },
  defaultError:function(){
      alert("error fetching data!"
      +"\n\nreadyState:"+this.req.readyState
      +"\nstatus: "+this.req.status
      +"\nheaders: "+this.req.getAllResponseHeaders());
      }
}
			


/************************************************************************************************************
*********************************************MY WORLD LINK HANDLER*******************************************
************************************************************************************************************/

function getLinkContent(linkInfo){
  if(document.location.toString().toLowerCase().indexOf("/manage") != -1){
    if(window.showAuthContent){showAuthContent(linkInfo.href);}
	return false;
  }else{
    return true;
  }
}


/************************************************************************************************************
***********************************************USER OPINION FORM*********************************************
************************************************************************************************************/


function showUserOpinionBox(){
    if(document.getElementById("leftMenu")){
		var div = document.getElementById("userOpinionBox");
		var body = document.getElementsByTagName('body').item(0);
		if(div && body){ body.removeChild(div); }
		//create floating div
		var div       = document.createElement("div");
		div.id        = "userOpinionBox";
		div.onclick   = expandUserOpinionBox;
		div.innerHTML = "Tell Us What<br><b>You</b> Think!"; 
		if(body){ body.appendChild(div); }
	}
}
function expandUserOpinionBox(){
    var div = document.getElementById("userOpinionBox");
    if(div){
       div.style.width  = "150px";
       div.style.height = "130px";
       div.style.cursor = "default";
       div.onclick      = "";
       div.innerHTML    = "<div align='right'><b style='cursor:pointer;' onclick='showUserOpinionBox();'>X</b></div>"+
         "<div id='commentContainer' style='z-index:1001;'>Tell us what you think<br>about World in Catalog:<br>"+
		 "<textarea id='textUserOpinion' "+
         "style='height:50px;width:100%;background-color:lightyellow;'></textarea><br>"+
         "<input style='font:10px Arial;text-decoration:none;font-weight:bold;' type='button' value='Go' onclick='submitUserOpinionBox();'></div>";
    }
}
function submitUserOpinionBox(){
    var opinion = document.getElementById("textUserOpinion").value.replace("\n"," ");
	var params = "submitted=yes&useropinion="+opinion;
    var loader = new xhr.ContentLoader("GET","../contact/?"+params,true,submitUserOpinionBoxHandler);
}
function submitUserOpinionBoxHandler(){
    //alert(this.req.responseText)
	var div = document.getElementById("commentContainer");
    if(div){div.innerHTML = "Comment sent. Thank you.";}
    setTimeout("showUserOpinionBox()",3000);
}
//window.onload = showUserOpinionBox;


/************************************************************************************************************
***********************************************ADS CLICK HANDLER*********************************************
************************************************************************************************************/

function adClick(theAd){
  var adurl = (theAd.href) ? theAd.href : theAd.src;
  var adtext = (theAd.innerHTML!="") ? theAd.innerHTML : "";
  var params = "adurl="+adurl+"&adtext="+adtext;
  var loader = new xhr.ContentLoader("GET","ad_click_handler.asp?"+params,true,adClickHandler);//alert("sad")
}
function adClickHandler(){  }


function showContactUserAboutItem(itemid,username){
	var url_params = "../contact/contactitem.asp?";
	if(itemid && itemid!=""){
		url_params += "itemid="+itemid;
	}else if(username && username!=""){
		url_params += "username="+username;
	}
	var iframehtml = "<iframe id='contactItemIFrame' width='100%' frameborder='0' scrolling='no' height='350' src='"+url_params+"'></iframe>";
	
	initFloatPopupBox(iframehtml,370,370,150,300,'Close','absolute','');
}



/************************************************************************************************************
********************************MARK AS SPAM, MISCATEGORIZED, PROHIBITED*************************************
************************************************************************************************************/
function markAs(type,itemid){
	var params = "submitted=yes&markas="+type+"&item="+itemid;
    var loader = new xhr.ContentLoader("GET","../contact/?"+params,true,markAsHandler);
	//confirmation
	var content = "<div class='content'>Thank you. World in Catalog has been informed about this item being marked as "+type+".</div>";	
	initFloatPopupBox(content,200,100,150,300,'Close','absolute','');
}
function markAsHandler(){}



function showGMapLocation(address){

	//<iframe width="300" height="300" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.com/maps?f=q&amp;hl=en&amp;geocode=&amp;time=&amp;date=&amp;ttype=&amp;q=Las+Vegas+NV+United+States&amp;ie=UTF8&amp;om=1&amp;s=AARTsJpmKCngDy7I4TE9WDskJMw6AOzAvQ&amp;ll=37.186579,-114.598389&amp;spn=2.625651,3.295898&amp;z=7&amp;iwloc=addr&amp;output=embed"></iframe>

	var content = "<iframe width='425' height='350' frameborder='0' scrolling='no' marginheight='0' marginwidth='0' " +
	"src='http://maps.google.com/maps?f=q&amp;hl=en&amp;geocode=&amp;time=&amp;date=&amp;ttype=&amp;q=" + address +
	"&amp;ie=UTF8&amp;ll=48.078079,9.052734&amp;spn=4.612227,8.668213&amp;z=7&amp;om=1&amp;" +
	"output=embed&amp;s=AARTsJobOm3Fpdkr8b4qoePoO_xD0VhAAQ'></iframe><br /><small>" +
	"<a target='_blank' href='http://maps.google.com/maps?f=q&amp;hl=en&amp;geocode=&amp;time=&amp;date=&amp;ttype=&amp;q=" + address +
	"&amp;ie=UTF8&amp;ll=48.078079,9.052734&amp;spn=4.612227,8.668213&amp;z=7&amp;om=1&amp;source=embed' " +
	" class='content-small' style='text-align:left'>View Larger Map</a></small>";
	initFloatPopupBox(content,450,370,150,300,'Close','absolute','');
}



function bodyLoadHandler(){if(window.initAccordion)initAccordion();}