var PushInfoDivDone = false
function PushInfoDiv()
{	if(PushInfoDivDone == false)
		{
			var Window = document.body
			var NewDiv = document.createElement('div');
			var Div_Id = 'MySite_InfoDiv';
			NewDiv.setAttribute('id',Div_Id);		
			NewDiv.innerHTML = '<Table width=100% Height=100% CEllpadding=0 Cellspacing=0 Class=INFODIV_DIVTBL><TR><TD ID=INFODIV_TITLE CLASS=INFODIV_HEADER></TD><TD align=right CLASS=INFODIV_HEADER><a href="javascript:CloseInFoDiv()"><img src=MCC_images/closebutton.gif border=0></a></TD></TR><TR ID=INFODIV_IFRAMETR><TD colspan=2 height=100%><IFRAME ID=INFODIV_IFRAME width=100% height=100% frameborder=0 framespacing=0 onload="INFODIVLOADED()"></IFRAME></TD></TR><TR ID=INFODIV_LOADTR><TD colspan=2 height=100% align=center Class=INFODIV_LOADING>Loading...</TD></TR></tablE>';	
			Window.appendChild(NewDiv);
			document.getElementById(Div_Id).style.position = 'absolute';
			document.getElementById(Div_Id).style.left = '0px';
			document.getElementById(Div_Id).style.top = '25px';
			PushInfoDivDone = true;
		}
}
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
function ShowInFoDiv(src,title,width,height)
{	PushInfoDiv()

	document.getElementById("INFODIV_TITLE").innerHTML= title;
	document.getElementById("INFODIV_IFRAMETR").style.display="none";
	document.getElementById("INFODIV_LOADTR").style.display="";
	document.getElementById("INFODIV_IFRAME").src = src;
	opacity('MySite_InfoDiv',0,100,500);
	document.getElementById("MySite_InfoDiv").style.width = width;
	document.getElementById("MySite_InfoDiv").style.height = height;
	var w=800;	var h=600;
	if(document.all){w=document.body.clientWidth; h=document.body.clientHeight;}
	if(document.layers) {w=window.innerWidth; h=window.innerHeight;}
	document.getElementById("MySite_InfoDiv").style.left = ((w - width) / 2);
	document.getElementById("MySite_InfoDiv").style.top = ((h - height) / 2);	
}
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
function INFODIVLOADED()
{
	document.getElementById("INFODIV_IFRAMETR").style.display="";
	document.getElementById("INFODIV_LOADTR").style.display="none";
}
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
function CloseInFoDiv()
{	opacity('MySite_InfoDiv',100,0,500);	}

//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
function opacity(id, opacStart, opacEnd, millisec) {	var speed = Math.round(millisec / 100);
	var timer = 0;
	if(opacStart > opacEnd) {
		for(i = opacStart; i >= opacEnd; i--) {
			setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
			timer++;
		}
	} else if(opacStart < opacEnd) {
		for(i = opacStart; i <= opacEnd; i++)
			{
			setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
			timer++;
		}
	}
}//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
function changeOpac(opacity, id) {
	var object = document.getElementById(id).style; 	if (opacity ==0) 		object.display ="none";	else		object.display ="";
	object.opacity = (opacity / 100);
	object.MozOpacity = (opacity / 100);
	object.KhtmlOpacity = (opacity / 100);
	object.filter = "alpha(opacity=" + opacity + ")";
}
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
function MCCEditTextArea(which)
{
	ShowInFoDiv('MCC_Edit.asp?TextArea=' + which,'Edit Text Area', 450, 450)
}
function MCCEditCategory(which)
{
	ShowInFoDiv('MCC_Edit.asp?Categories=' + which,'Edit Categories', 450, 450)
}
function MCCAddProduct(which,id)
{
	ShowInFoDiv('MCC_Edit.asp?Product=' + which + '&ID=' + id,'Edit Items', 600, 500)
}
function MCCProductList(which,id)
{
	ShowInFoDiv('MCC_Edit.asp?ProductOrder=' + which + '&ID=' + id,'Product List', 600, 500)
}
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
function MCC_BrowseIMG(which)
{
	window.open ("MCC_Edit.asp?Input=" + which,"MCCUploader","status=1,toolbar=0,height=800",width="600");
}
function stringReplace(strSource, strFind, strReplace){
var temp = strSource;
var result = "";
while (temp.length > 0){ 
index = temp.indexOf(strFind);
if (index >= 0){
result += temp.substring(0, index);
result += strReplace;
temp = temp.substring(index + strFind.length)
} else { 
result += temp;
temp = ""
}

}

return result
}
var MCCCurrentBrowseIMGFile=''
function MCCSetCurrentFile(which)
{	MCCCurrentBrowseIMGFile = which;
	MCCCurrentBrowseIMGFile = unescape(MCCCurrentBrowseIMGFile)
	MCCCurrentBrowseIMGFile = stringReplace(MCCCurrentBrowseIMGFile,'+','%20')
	
    document.getElementById('INPUTCURRENTURL').innerHTML= 'File URL: ' + MCCCurrentBrowseIMGFile;}
function MCCSetInput(Input, closewindow)
{	if(MCCCurrentBrowseIMGFile !='')
	{
		window.opener.document.getElementById(Input).value=unescape(MCCCurrentBrowseIMGFile);
		if(closewindow ==1)
		window.close();	
	}
	else
		alert('Please Select the file you wish to use before clicking here');
}

//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
function MCCCheckImage(obj,w,h)
{	if(w != '')
		if(obj.width > w)
			obj.width = w;
	if(h != '')
		if(obj.height > h)
			obj.height = h;
}
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
function MCCDelUsr(which)
{
	ShowInFoDiv('MCC_Edit.asp?DelUser=' + which,'Delete User', 350, 200)
}
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
function MCCDelTrivia(which)
{
	ShowInFoDiv('MCC_Edit.asp?DelTrivia=' + which,'Delete Trivia', 350, 200)
}
