//document.body.style.scrollbarBaseColor='#0000FF'
//document.body.style.scrollbarArrowColor='#FFFF00'
//document.body.style.scrollbarDarkShadowColor='#000080'
//document.body.style.scrollbarFaceColor='#770000'
//document.body.style.scrollbarHighlightColor='#FFFF00'
//document.body.style.scrollbarShadowColor='#000000'
//document.body.style.scrollbar3dlightColor='#FFFF00'


//function glowit(which){
//	if (document.all.glowtext[which].filters[0].strength==3)
//		document.all.glowtext[which].filters[0].strength=2;
//	else
//		document.all.glowtext[which].filters[0].strength=3;
//}
                                                     
//function glowit2(which){
//	if (document.all.glowtext.filters[0].strength==3)
//		document.all.glowtext.filters[0].strength=2;
//	else
//		document.all.glowtext.filters[0].strength=3;
//}
                                                     
//function startglowing(){
//	if (document.all.glowtext&&glowtext.length){
//		for (i=0;i<glowtext.length;i++)
//		eval('setInterval("glowit('+i+')",150)');
//	} 
//	else if (glowtext);
//		setInterval("glowit2(0)",150);
//}
                                                     
//if (document.all)
//window.onload=startglowing;

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function showHideLayers() { //v3.0A
var i,p,v,obj,args=showHideLayers.arguments;if(document.getElementById){
for (i=0; i<(args.length-2); i+=3){ obj=tmt_findObj(args[i]);v=args[i+2];
v=(v=='show')?'visible':(v='hide')?'hidden':v;
if(obj)obj.style.visibility=v;}} else{
for (i=0; i<(args.length-2); i+=3) if ((obj=findObj(args[i]))!=null) { v=args[i+2];
if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
obj.visibility=v; }}
}

function findObj(n, d) { //v3.0
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=findObj(n,d.layers[i].document); return x;
}

function tmt_findObj(n){ //v3.0A
var x,t; if((n.indexOf("?"))>0&&parent.frames.length){t=n.split("?");
x=eval("parent.frames['"+t[1]+"'].document.getElementById('"+t[0]+"')");
}else{x=document.getElementById(n)}return x;
}

var tid=null;

function showMenu(menuName) {
	 hideall();
	 if (tid != null) {window.clearTimeout(tid);}
	 showHideLayers(menuName,'','show');
}

function hideMenu(menuName) {
     if (tid != null) {window.clearTimeout(tid);}
	 tid=window.setTimeout('hideall()',1000);
}

function hideall() {
		 showHideLayers('welcome','','hide');
		 showHideLayers('ourpottery','','hide');
		 showHideLayers('catalog','','hide');
		 showHideLayers('memberarea','','hide');
		 showHideLayers('company','','hide');
		 showHideLayers('contact','','hide');
		 showHideLayers('accountmanager','','hide');
}

function showPottery(menuName,id) {
	 hideall();
	 change(id, 'on', 'yes');
	 if (tid != null) {window.clearTimeout(tid);}
	 showHideLayers(menuName,'','show');
}

function hidePottery(menuName,id) {
	 change(id, 'off', 'yes');
     if (tid != null) {window.clearTimeout(tid);}
//   tid=window.setTimeout(showHideLayers(menuName,'','hide'), 1000);
	 showHideLayers(menuName,'','hide');
}

function gotoURL(URL) {
	location.href = URL;
}

function displayConfirm(MSG)
{
if (!confirm(MSG))
	return false;
else
	return true;
}

function displayConfirm1(form, orderid, MSG)
{
if (!confirm(MSG))
	return false;
//	window.status = form.orderstatus_orderid.selectedIndex
//	window.alert('test');
else
	return true;
	form.submited;
}


function change(obj, onoff, img) {

var imgOn	= new Image()
var imgOff	= new Image()
var imgYes	= new Image()
var imgNo	= new Image()
imgOn.src	= '/Images/bu_tri_r.gif'
imgOff.src	= '/Images/bu_tri_y.gif'
imgYes.src	= '/Images/bu_tri_y1.gif'
imgNo.src	= '/Images/bu_tri_r1.gif'

var nodeTR = document.getElementById(obj)		//TR Node
var nodeImg
nodeImg = nodeTR.firstChild

if (onoff == 'on') {
	nodeTR.style.color = '#000000'
	nodeTR.style.backgroundColor = '#FFCC00'
	if (img == 'yes') {
		nodeImg.src = imgOn.src
	} else {
		nodeImg.src = imgYes.src
	}
}
else if (onoff == 'off') {
	nodeTR.style.color = '#FFFFFF'
	nodeTR.style.backgroundColor = '#770000'
	if (img == 'yes') {
		nodeImg.src = imgOff.src
	} else {
		nodeImg.src = imgNo.src
	}
}
}

function popwin(mypage){
pos='center';
w=350;
h=250;
myname='';
scrollbars='no';
if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;}
else if((pos!="center" && pos!="random") || pos==null){LeftPosition=0;TopPosition=20}
settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=yes';
win=window.open(mypage,myname,settings);}

function openWindowCenter(Filename, WindowHeight, WindowWidth) {
	var tmpWin1;	
	var LeftPosition=(screen.width)?(screen.width-WindowWidth)/2:100;
	var TopPosition=(screen.height)?(screen.height-WindowHeight)/2:100;
	tmpWin1 = window.open(Filename, "NewWindow", "status=no,resizable=no,scrollbars=no,top=" + TopPosition + ",left=" + LeftPosition + ",height=" + WindowHeight + ",width=" + WindowWidth);
	tmpWin1.focus();
}

function openWindow(Filename, WindowHeight, WindowWidth) {
	var tmpWin2;	
//	var LeftPosition=(screen.width)?(screen.width-WindowWidth)/2:100;
//	var TopPosition=(screen.height)?(screen.height-WindowHeight)/2:100;
	var LeftPosition=(screen.width-WindowWidth-10);
	var TopPosition=0;
	tmpWin2 = window.open(Filename, "NewWindow", "status=no,resizable=yes,scrollbars=yes,top=" + TopPosition + ",left=" + LeftPosition + ",height=" + (screen.height-58) + ",width=" + WindowWidth);
	tmpWin2.focus();
}

function openAnotherWindow(Filename, WindowHeight, WindowWidth) {
	var NewWin1;	
	NewWin1 = window.open(Filename, "NewWin", "status=no,resizable=yes,scrollbars=yes,height=" + WindowHeight + ",width=" + WindowWidth);
	NewWin1.focus();
}

function openFullWindow(Filename, WindowHeight, WindowWidth) {
	var NewWin2;	
	NewWin2 = window.open(Filename, "NewWin1", "toolbar=yes,status=yes,resizable=yes,scrollbars=yes,location=yes,directories=yes,menubar=yes,height=" + WindowHeight + ",width=" + WindowWidth);
	NewWin2.focus();
}


var supported = (window.Option) ? 1 : 0;

if (supported) {
var active;
var ar = new Array();

ar[0] = new Array();
ar[0][0] = new makeOption("", "");

ar[1] = new Array();
ar[1][0] = new makeOption("-- Select a color --", "");
ar[1][1] = new makeOption("Blue", "/search.asp?SearchBy=Colors&SearchKey=Blue&SearchFullKey=Blue");
ar[1][2] = new makeOption("Green", "/search.asp?SearchBy=Colors&SearchKey=Green&SearchFullKey=Green");
ar[1][3] = new makeOption("Brown", "/search.asp?SearchBy=Colors&SearchKey=Brown&SearchFullKey=Brown");
ar[1][4] = new makeOption("Honey", "/search.asp?SearchBy=Colors&SearchKey=Honey&SearchFullKey=Honey");
ar[1][5] = new makeOption("White", "/search.asp?SearchBy=Colors&SearchKey=White&SearchFullKey=Off%20White");
ar[1][6] = new makeOption("Beige", "/search.asp?SearchBy=Colors&SearchKey=Beige&SearchFullKey=Beige");
ar[1][7] = new makeOption("Antrazit Grey", "/search.asp?SearchBy=Colors&SearchKey=Antrazit%20Grey&SearchFullKey=Antrazit%20Grey");
ar[1][8] = new makeOption("Black", "/search.asp?SearchBy=Colors&SearchKey=Black&SearchFullKey=Black");
ar[1][9] = new makeOption("Grey", "/search.asp?SearchBy=Colors&SearchKey=Grey&SearchFullKey=Grey");
ar[1][10] = new makeOption("Orange", "/search.asp?SearchBy=Colors&SearchKey=Orange&SearchFullKey=Orange");
ar[1][11] = new makeOption("Red", "/search.asp?SearchBy=Colors&SearchKey=%20Red&SearchFullKey=Red");
ar[1][12] = new makeOption("Yellow", "/search.asp?SearchBy=Colors&SearchKey=Yellow&SearchFullKey=Yellow");
ar[1][13] = new makeOption("Creme", "/search.asp?SearchBy=Colors&SearchKey=Creme&SearchFullKey=Creme");
ar[1][14] = new makeOption("Salt Glazed", "/search.asp?SearchBy=Colors&SearchKey=Salt&SearchFullKey=Salt%20Glazed");

ar[2] = new Array();
ar[2][0] = new makeOption("-- Select a diameter range --", ""); 
ar[2][1] = new makeOption("Mini (Diameter 19 cm or under)", "/search.asp?SearchBy=Sizes&SearchKey=0-19&SearchFullKey=Mini%20(Diameter%2019%20cm%20or%20under)");
ar[2][2] = new makeOption("Small (Diameter 20 - 29 cm)", "/search.asp?SearchBy=Sizes&SearchKey=20-29&SearchFullKey=Small%20(Diameter%2020%20-%2029%20cm)");
ar[2][3] = new makeOption("Medium (Diameter 30 - 39 cm)", "/search.asp?SearchBy=Sizes&SearchKey=30-39&SearchFullKey=Medium%20(Diameter%2030%20-%2039%20cm)");
ar[2][4] = new makeOption("Large (Diameter 40 - 49 cm)", "/search.asp?SearchBy=Sizes&SearchKey=40-49&SearchFullKey=Large%20(Diameter%2040%20-%2049%20cm)");
ar[2][5] = new makeOption("XLarge (Diameter 50 cm or above)", "/search.asp?SearchBy=Sizes&SearchKey=50-99&SearchFullKey=XLarge%20(Diameter%2050%20cm%20or%20above)");

ar[3] = new Array();
ar[3][0] = new makeOption("-- Select a design --", ""); 
ar[3][1] = new makeOption("Plain (Rim Glazed)", "/search.asp?SearchBy=Designs&SearchKey=Rim%20Glazed&SearchFullKey=Plain%20(Rim%20Glazed)");
ar[3][2] = new makeOption("Plain (Rim Unglazed)", "/search.asp?SearchBy=Designs&SearchKey=Rim%20Unglazed&SearchFullKey=Plain%20(Rim%20Unglazed)");
ar[3][3] = new makeOption("With Carving", "/search.asp?SearchBy=Designs&SearchKey=Carving&SearchFullKey=With%20Carving");
ar[3][4] = new makeOption("With Painted Art", "/search.asp?SearchBy=Designs&SearchKey=Paint&SearchFullKey=With%20Painted%20Art");
ar[3][5] = new makeOption("With Glazed Pattern", "/search.asp?SearchBy=Designs&SearchKey=Pattern&SearchFullKey=With%20Glazed%20Pattern");
ar[3][6] = new makeOption("Sandy Design", "/search.asp?SearchBy=Designs&SearchKey=Sandy&SearchFullKey=Sandy%20Design");
}

function makeOption(text, url) {
this.text = text;
this.url = url;
}

function relate(form) {
  if (!supported) {
    load(form, "searchby");
    return;
  }
  var options = form.list.options;
  for (var i = options.length - 1; i > 0; i--) {
    options[i] = null;
  }
  var curAr = ar[form.searchby.selectedIndex];
  for (var j = 0; j < curAr.length; j++) {
    options[j] = new Option(curAr[j].text, curAr[j].url);
  }
  options[0].selected = true;
}

function load(form, name) {
  var url = form[name].options[form[name].selectedIndex].value;
  if (url != "") location.href = url;
  return false;
}

var pageurl="http://www.mypottery.com.my";
var title="myPOTTERY.com.my - Malaysian Pottery Portal";

function bookmark() {
if ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4)) {
document.write('<A class="bottomlink" HREF="javascript:window.external.AddFavorite(pageurl,title);" ');
document.write('onMouseOver=" window.status=');
document.write("'Add myPOTTERY To Your Favorites !'; return true ");
document.write('"onMouseOut=" window.status=');
document.write("' '; return true ");
document.write('">Add myPOTTERY To Your Favorites !</a>');
}
else {
var msg = "<font class=\"bottomlink\">Bookmark myPOTTERY ! ";
if(navigator.appName == "Netscape") msg += "(Press CTRL+D)</font>";
document.write(msg);
}
}

function blink (elId) {
  var html = '';
  if (document.all)
    html += 'var el = document.all.' + elId + ';';
  else if (document.getElementById)
    html += 'var el = document.getElementById("' + elId + '");';
  html += 
    'el.style.visibility = ' + 
    'el.style.visibility == "hidden" ? "visible" : "hidden"';
  if (document.all || document.getElementById)
    setInterval(html, 800)
}

function TimeOut() {
	window.location = '/Admin/Default.asp?TimeOut=1';
}
