function hideShowItem(obj, txtobj)
{
	var item = document.getElementById(obj);
	var txtItem = document.getElementById(txtobj);
	
	if(item.style.display=="none" || item.style.display=="")
	{
		item.style.display="block";
		txtItem.innerHTML = "[-]";
	}
	else
	{
		item.style.display="none";
		txtItem.innerHTML = "[+]";
	}	
}

function GoToPage(sUrl)
{
	window.location = sUrl;
}


function HideThumbNail()
{
   HideContent("showimage");
}

function ShowThumbNail(whichimg)
{
    var obj = document.getElementById("showimage");
    obj.innerHTML = "<img src='images/categoryitem/" + whichimg + "' style=\"border:0px\" />";
    ShowContent("showimage");
}
var cX = 0; var cY = 0; var rX = 0; var rY = 0;

function UpdateCursorPosition(e){ cX = e.pageX; cY = e.pageY;}
function UpdateCursorPositionDocAll(e){ cX = event.clientX; cY = event.clientY;}

if(document.all) { document.onmousemove = UpdateCursorPositionDocAll; }
else { document.onmousemove = UpdateCursorPosition; }

function AssignPosition(d) 
{
    if(self.pageYOffset) {
        rX = self.pageXOffset;
        rY = self.pageYOffset;
        }
    else if(document.documentElement && document.documentElement.scrollTop) {
        rX = document.documentElement.scrollLeft;
        rY = document.documentElement.scrollTop;
        }
    else if(document.body) {
        rX = document.body.scrollLeft;
        rY = document.body.scrollTop;
        }
    if(document.all) {
        cX += rX; 
        cY += rY;
        }
        
    //alert(cX + " - " + cY);
    // 565 55
    
    d.style.left = cX + "px";
    d.style.top = cY + "px";
}

function HideContent(d) {
    if(d.length < 1) { return; }
    document.getElementById(d).style.display = "none";
    document.getElementById(d).style.zIndex = -1;
}

function ShowContent(d) 
{
    if(d.length < 1) { return; }
    var dd = document.getElementById(d);
    AssignPosition(dd);
    dd.style.display = "block";
    dd.style.zIndex = 9999;
}

function SuggestionAdded(msg)
{
    alert(msg);
}

function ShowContainer()
{
    document.getElementById("flashcontainer").style.display = "block";
}

function OpenPrizedrawPopup()
{
    OpenWindow('Pop_PrizeDraw.aspx','width=677,height=500');
}


function OpenPrivacyPopup()
{
    OpenWindow('Pop_PrivacyPolicy.aspx','width=677,height=500,scrollbars=yes');
}

function OpenSurveyPrivacyPopup()
{
    OpenWindow('Pop_SurveyPrivacy.aspx','width=677,height=500');
}

function OpenWindow(url,features)
{
    if(winopen)
        winopen.close();
        
    var winopen = window.open(url, 'winopen',features);
    
    if(winopen)
        winopen.focus();
}
