window.status="N-2-Stitches Custom Embroidery";

function init()
{
	//getPg("main");
	alert("test");
}


function colorRow(vpg, vOn)
{
	var vobj = vpg;
	if(vOn == 1)
	{
		vobj.oldclassName = vobj.className;
		vobj.className = "hlight";
	}
	else {
		if(vobj.className != "selected"){
		vobj.className = vobj.oldclassName;
		}
	}
}

function rowOn(vpg){colorRow(vpg,1);}

function rowOff(vpg){colorRow(vpg,0);}



function getPg(vpg) {
var pg = vpg;
var url = "/n2stitches/" + pg + ".htm";
//var url = pg + ".htm";
var tst = getPage(url, false);
//messageWindow("TEST", url + "<br>" + tst, "TEST");
gbi("bod").innerHTML = tst;
}


function gbi(vname){return document.getElementById(vname);}

//function messageWindow(title, msg, wname, iheight, iwidth, nobutton)
function messageWindow(title, msg, wname)
{
//messageWindow('View Image', 'kids/kid1.jpg', 'View Image')
  var width="400", height="325";
//	height = (typeof iheight != "undefined" && iheight > 0) ? iheight : height;
//	width = (typeof iwidth != "undefined" && iwidth > 0) ? iwidth : width;
//	var nm = "";
//	nm = wname != "undefined" ? wname : "msgwindow";
  var left = (screen.width/2) - width/2;
  var top = (screen.height/2) - height/2;
  var stylestr = "toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,";
	stylestr += "width="+width+",height="+height+",left="+left+",top="+top+",screenX="+left+",screenY="+top;
  window.open("http://www.gulftel.com/n2stitches/"  + msg, "Imageview", stylestr);
//  var head = "<head><title>"+title+"</title></head>";
//  var txt = msg.replace(/\~\~/g,'<br>') +"<br>"
//  txt += "<p><input type=\"button\" value=\"   Done   \" onClick=\"self.close()\">";
}



 

function getPage(url, vstrip)
{
	var txt = "";
	var xmlhttp=false;
	
 	try
		{xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");}
	catch (e)
		{xmlhttp = false;}

	if (!xmlhttp && typeof XMLHttpRequest!= "undefined")
	{xmlhttp = new XMLHttpRequest();}
	
  xmlhttp.open("GET", url, false);
  xmlhttp.send(txt);
	
	if(vstrip == true)
	{
		var ptn = /[\W]/g;
		return(xmlhttp.responseText.replace(ptn,""))
	}
	else
	{
		return(xmlhttp.responseText);
	}
}

