﻿//if (top.frames.length > 0)
//{
// top.location=self.location;
//}



function setVisible(divID)
{
    var objDiv = document.getElementById(divID);
    
    if (objDiv.style.display == "none")
        objDiv.style.display = "block";
    else
        objDiv.style.display = "none";
}

function changeStyleMainItem(obj, flag)
{
    if (flag == 0)
        obj.style.color = "#ff0000";
    else
        obj.style.color = "#000000";
}

function changeStyleSubItem(obj, flag)
{
    if (flag == 0)
        obj.style.color = "#ff0000";
    else
        obj.style.color = "#696969";
}

function redirectProductList(subCatalogID)
{
    window.location = "underconstruction.htm";
}
function getProductListInSubCatalog(subCatalogID)
{
    window.location = "underconstruction.htm";
}
// JavaScript Document
nereidFadeObjects = new Object();
nereidFadeTimers = new Object();
function nereidFade(object, destOp, rate, delta){
if (!document.all)
return
    if (object != "[object]"){  //do this so I can take a string too
        setTimeout("nereidFade("+object+","+destOp+","+rate+","+delta+")",0);
        return;
    }
    clearTimeout(nereidFadeTimers[object.sourceIndex]);
    diff = destOp-object.filters.alpha.opacity;
    direction = 1;
    if (object.filters.alpha.opacity > destOp){
        direction = -1;
    }
    delta=Math.min(direction*diff,delta);
    object.filters.alpha.opacity+=direction*delta;
    if (object.filters.alpha.opacity != destOp){
        nereidFadeObjects[object.sourceIndex]=object;
        nereidFadeTimers[object.sourceIndex]=setTimeout("nereidFade(nereidFadeObjects["+object.sourceIndex+"],"+destOp+","+rate+","+delta+")",rate);
    }
}

function startTrans(a,fname)

{
		a.filters[0].Apply();
		a.src = "imageproducts/" + fname;
		a.filters[0].Play()
}
function TellAFriend(url) 
{
		
		wName = "h" + url.length;
		var href = "/Email2Friend.aspx?yoururl=" + url
		opt = "left=" + (screen.availWidth-500)/2 + ",top=" + (screen.availHeight-350)/2
		opt += ",height=350,width=500"
		window.open(href,wName,opt)		
}
//For News Details
function Feedback(gt,id) 
{
		var href = "/NewsFeedback.aspx?GT="+gt+"&NewsPK=" + id
		opt = "left=" + (screen.availWidth-500)/2 + ",top=" + (screen.availHeight-400)/2
		opt += ",height=400,width=500"
		window.open(href,"NewsFeedback",opt)		
}

// Detail
function FeedbackDetail(id) 
{
		var href = "/NewsFeedback.aspx?ItemPK=" + id
		opt = "left=" + (screen.availWidth-500)/2 + ",top=" + (screen.availHeight-400)/2
		opt += ",height=400,width=500"
		window.open(href,"NewsDetail",opt)		
}
