if ((navigator.appName == "Netscape")&&(parseInt(navigator.appVersion) > 4)){
	//document.addEventListener("click", click, false);
}
else{
	//document.onmousedown = click
}

function click(e){

	if (navigator.appName == "Netscape"){ // Netscape
		if (parseInt(navigator.appVersion) <= 4){
			if (e.which != 1){
				alert('This function has been disabled.')
				return false;
			}
		}
		else{
			if (e.button != 0){
				alert('This function has been disabled.')
				e.preventDefault()
				e.stopPropagation();
			}
		}
	}
	else if (document.all){ //IE
		if (event.button != 1){
			alert('This function has been disabled.')
		}
	}

}

function stripUrl(nameRef){
	var index;
	var endstr;
	var myString;
	var name = nameRef;
	
	myString = String(document.location)
	index = myString.indexOf(name + "=");
	
	if (index == -1){
		return null;
	}
	
	index = myString.indexOf("=", index) + 1;
	
	endstr = myString.indexOf(";", index);
	
	if (endstr == -1){
		endstr = myString.length;
	}
	
	return unescape(myString.substring(index, endstr));
}

var sTemp = 0;
sTemp = stripUrl("s");

function buttonImageSwap(event,obj,imageName){
	if (event == 1){
		obj.src = ('/mowrockland/Images/' + imageName + '_n.jpg');
	}
	if (event == 2){
		obj.src = ('/mowrockland/Images/' + imageName + '_r.jpg');
	}
	if (event == 3){
		obj.src = ('/mowrockland/Images/' + imageName + '_d.jpg');
	}
	if (event == 4){
		obj.src = ('/mowrockland/Images/' + imageName + '_n.jpg');
	}
}

function buttonImageSwapGif(event,obj,imageName){
	if (event == 1){
		obj.src = ('Images/' + imageName + '_n.gif');
	}
	if (event == 2){
		obj.src = ('Images/' + imageName + '_r.gif');
	}
	if (event == 3){
		obj.src = ('Images/' + imageName + '_d.gif');
	}
	if (event == 4){
		obj.src = ('Images/' + imageName + '_n.gif');
	}
}

function showSubHTM(ref){
	top.mainAction.document.location = ref + ".htm"
}

function showSubASP(ref){
	top.mainAction.document.location = ref + ".asp"
}

var myDate = new Date();

myDay = myDate.getDate()
myYear = myDate.getYear()
myMonth = myDate.getMonth()

switch(myMonth){
	case 0: myMonth = "January";
		break;
	case 1: myMonth = "February";
		break;
	case 2: myMonth = "March";
		break;
	case 3: myMonth = "April";
		break;
	case 4: myMonth = "May";
		break;
	case 5: myMonth = "June";
		break;
	case 6: myMonth = "July";
		break;
	case 7: myMonth = "August";
		break;
	case 8: myMonth = "September";
		break;
	case 9: myMonth = "October";
		break;
	case 10: myMonth = "November";
		break;
	case 11: myMonth = "December";
		break;
}

if ((myDay == 1)||(myDay == 21)||(myDay == 31)){
	myType = "st"
}
else if ((myDay == 2)||(myDay == 22)){
	myType = "nd"
}
else if ((myDay == 3)||(myDay == 23)){
	myType = "rd"
}
else{
	myType = "th"
}

if(navigator.userAgent.indexOf('Win') == -1) {
        platform = 'MAC';
} else {
        platform = 'WIN';
}

if (navigator.appName == "Netscape"){	// Netscape
	if (parseInt(navigator.appVersion) <= 4){
		myStyles = "";
		myAll = ".";
		myBrowser = "NS";
	}
	else{
		myStyles = "').style";
		myAll = ".getElementById('";
		myBrowser = "NS6";
	}
}
else if (document.all){		//IE
	myStyles = ".style";
	myAll = ".all.";
	myBrowser = "IE";
}

function goProfile(){
	top.sideMenu.document.location = "/CoSideMenu.htm"
	top.mainAction.document.location = "/Company/Profile.htm"
}

function goServices(){
	top.sideMenu.document.location = "/SeSideMenu.htm"
	top.mainAction.document.location = "/SeMain.htm"
}

function goPrivacy(){
	top.sideMenu.document.location = "/CoSideMenu.htm"
	top.mainAction.document.location = "/Company/Privacy.htm"
}

function goGetPage(side,main){
	top.sideMenu.document.location = "/" + side + "SideMenu.htm"
	top.mainAction.document.location = main
}

function sendMail(obj){
	
	if (!checkKeyboardCharacters(obj.myName, 'Name',10)){
		return;
	}
	
	if (obj.myCompany.value != ""){
		if (!checkKeyboardCharacters(obj.myCompany, 'Company',10)){
			return;
		}
	}

	if (obj.myEmail.value != ""){
		if (!checkEmail(obj.myEmail)){
			return;
		}
	}
	else{
		alert("Email may not be blank");
		obj.myEmail.focus();
		obj.myEmail.select();
		return;
	}
	
	if (!checkStandard(obj.myPhone,'Phone Number',4)){
		return;
	}
	
	if (!checkAllCharacters(obj.Message,'Message',4)){
		return;
	}
	//var myString
	
	//myString = ("Name: " + obj.myName.value)
	//myString = (myString + "\nCompany: " + obj.myCompany.value)
	//myString = (myString + "\nE-mail: " + obj.myEmail.value)
	//myString = (myString + "\nPhone: " + obj.myPhone.value)
	//myString = (myString + "\nHeard: " + obj.howHeard.options[obj.howHeard.selectedIndex].text)
	//myString = escape(myString + "\nMessage: " + obj.Message.value)
	
	//document.location.href = "mailto:solutions@e-masque.com?Subject=" + obj.interest.options[obj.interest.selectedIndex].text + "&Body=" + myString
	
	obj.action="ThankYou.asp";
	obj.submit();

}

function stdRollover(obj,myColor){
	obj.style.color = myColor
}

function stdRollout(obj,myColor){
	obj.style.color = myColor
}

function myRollOver(obj,bgColor){
	obj.style.backgroundColor=String(bgColor)
	obj.style.color='#FFFFFF'
	obj.style.bordertop = 'solid 2px #FFFFFF'
	obj.style.borderleft = 'solid 2px #FFFFFF'	
}

function myRollOut(obj,bgColor){
	obj.style.backgroundColor=String(bgColor)
	obj.style.color='#FFFFFF'
	obj.style.bordertop = 'solid 2px #CCCCFF'
	obj.style.borderleft = 'solid 2px #9999FF'	
}
var myWin
function openNewWindow(winWidth,winHeight,pageRef,myTitle,sb,tb,sc,rs,mu){

	if (navigator.appName == "Netscape"){ // Netscape
		if (parseInt(navigator.appVersion) <= 4){
			myWidth = (screen.width - winWidth) / 2;
			myHeight = (screen.height - winHeight) / 2;
			myBrowser2 = "NS";
		}
		else{
			myWidth = (screen.width - winWidth) / 2;
			myHeight = (screen.height - winHeight) / 2;
			myBrowser2 = "NS6";
		}
	}
	else if (document.all){ //IE
		myWidth = (screen.width - winWidth) / 2;
		myHeight = (screen.height - winHeight) / 2;
		myBrowser2 = "IE";
	}
	myParams = "width=" + winWidth + ",height=" + winHeight + ",status=" + sb + ",toolbar=" + tb + ",scrollbars=" + sc + ",resizable=" + rs + ",menubar=" + mu
 	
 	myWin = window.open("",String(myTitle),String(myParams))
	myWin.moveTo(myWidth,myHeight)
	myWin.focus()
 	myWin.document.location = pageRef

}

function stdEngineRollover(obj){
	obj.style.color = "#FF0000"
}

function stdEngineRollout(obj){
	obj.style.color = "#0000CC"
}

function myEngineRollOver(obj){
	obj.style.backgroundColor = "#8889A5"
	obj.style.backgroundImage = 'url(/Images/Mgt/GButtBack_d.jpg)'
	obj.style.color = '#FFFFFF'
	obj.style.bordertop = 'solid 1px #272939'
	obj.style.borderleft = 'solid 1px #383A4C'	
	obj.style.borderright = 'solid 1px #E4E7FF'
	obj.style.borderbottom = 'solid 1px #E4E7FF'	
}

function myEngineRollOut(obj){
	obj.style.backgroundColor = "#FFFFFF"
	obj.style.backgroundImage = 'url(/Images/Mgt/GButtBack_n.jpg)'
	obj.style.color = '#000000'
	obj.style.bordertop = 'solid 1px #E4E7FF'
	obj.style.borderleft = 'solid 1px #E4E7FF'	
	obj.style.borderright = 'solid 1px #383A4C'
	obj.style.borderbottom = 'solid 1px #272939'	
}

function myGrEngineRollOver(obj){
	obj.style.backgroundColor = "#F48602"
	obj.style.backgroundImage = 'url(/Images/Mgt/OButtBack_d.jpg)'
	obj.style.color = '#FFFFFF'
	obj.style.bordertop = 'solid 2px #4E0004'
	obj.style.borderleft = 'solid 2px #4E0004'	
	obj.style.borderright = 'solid 1px #F6E7A1'
	obj.style.borderbottom = 'solid 1px #F6E7A1'	
}

function myGrEngineRollOut(obj){
	obj.style.backgroundColor = "#F6E7A1"
	obj.style.backgroundImage = 'url(/Images/Mgt/OButtBack_n.jpg)'
	obj.style.color = '#4E0004'
	obj.style.bordertop = 'solid 2px #F6E7A1'
	obj.style.borderleft = 'solid 2px #F6E7A1'	
	obj.style.borderright = 'solid 1px #4E0004'
	obj.style.borderbottom = 'solid 1px #4E0004'	
}

function myBlEngineRollOver(obj){
	obj.style.backgroundColor = "#8889A5"
	obj.style.backgroundImage = 'url(/Images/Mgt/GButtBack_d.jpg)'
	obj.style.color = '#FFFFFF'
	obj.style.bordertop = 'solid 1px #272939'
	obj.style.borderleft = 'solid 1px #383A4C'	
	obj.style.borderright = 'solid 1px #E4E7FF'
	obj.style.borderbottom = 'solid 1px #E4E7FF'	
}

function myBlEngineRollOut(obj){
	obj.style.backgroundColor = "#FFFFFF"
	obj.style.backgroundImage = 'url(/Images/Mgt/GButtBack_n.jpg)'
	obj.style.color = '#000000'
	obj.style.bordertop = 'solid 1px #E4E7FF'
	obj.style.borderleft = 'solid 1px #E4E7FF'	
	obj.style.borderright = 'solid 1px #383A4C'
	obj.style.borderbottom = 'solid 1px #272939'	
}

function myRedEngineRollOver(obj){
	obj.style.backgroundColor = "#990000"
	obj.style.backgroundImage = 'url(/Images/Mgt/RButtBack_d.jpg)'
	obj.style.color = '#FFFFFF'
	obj.style.bordertop = 'solid 1px #5B0505'
	obj.style.borderleft = 'solid 1px #5B0505'	
	obj.style.borderright = 'solid 1px #FFCECE'
	obj.style.borderbottom = 'solid 1px #FFCECE'	
}

function myRedEngineRollOut(obj){
	obj.style.backgroundColor = "#FF4646"
	obj.style.backgroundImage = 'url(/Images/Mgt/RButtBack_n.jpg)'
	obj.style.color = '#FFF17D'
	obj.style.bordertop = 'solid 1px #FFCECE'
	obj.style.borderleft = 'solid 1px #FFCECE'	
	obj.style.borderright = 'solid 1px #5B0505'
	obj.style.borderbottom = 'solid 1px #5B0505'	
}

function myPRollOver(obj){
	obj.style.backgroundImage = 'url(/Images/Buttons/Print_r.jpg)'	
}

function myPRollOut(obj){
	obj.style.backgroundImage = 'url(/Images/Buttons/Print_n.jpg)'
}

function myPRollDown(obj){
	obj.style.backgroundImage = 'url(/Images/Buttons/Print_d.jpg)'
}

function format(expr, decplaces){
	
	var str = "" + Math.round(eval(expr) * Math.pow(10,decplaces))
	while (str.length <= decplaces){
		str = "0" + str
	}
	var decpoint = str.length - decplaces
	return str.substring(0,decpoint) + "." + str.substring(decpoint,str.length)
}

function displayLink(url){
	if (url != "#"){
		if (url.indexOf("http") == -1){
			window.open("/Images/Links/" + url)
		}
		else{
			window.open(url)
		}
	}
}

function galleryImageUpdate(iRef, iName){
	imgRef = iRef
	sImage.src = "/Images/Gallery/" + imgRef
	if (iName == "0"){
		iName = "&nbsp;"
		sImage.alt = ""
	}
	else{
		sImage.alt = iName
	}
	document.getElementById('first2').innerHTML = iName
}

function vcMenuOver(obj){
	obj.style.borderTop = 'solid 1px #FFCCCC'
	obj.style.borderLeft = 'solid 1px #FFCCCC'
	obj.style.borderRight = 'solid 1px #000000'
	obj.style.borderBottom = 'solid 1px #000000'
	obj.style.backgroundColor = '#FF0000'
	obj.style.color = '#FFFFCC'
	obj.style.fontSize = '14px'
}

function vcMenuOut(obj){
	obj.style.borderTop = 'solid 1px #CCCCCC'
	obj.style.borderLeft = 'solid 1px #CCCCCC'
	obj.style.borderRight = 'solid 1px #000000'
	obj.style.borderBottom = 'solid 1px #000000'
	obj.style.backgroundColor = '#000000'
	obj.style.color = '#FFFFFF'
}

function vcMenuDown(obj){
	obj.style.borderTop = 'solid 1px #000000'
	obj.style.borderLeft = 'solid 1px #000000'
	obj.style.borderRight = 'solid 1px #FFCCCC'
	obj.style.borderBottom = 'solid 1px #FFCCCC'
	obj.style.color = '#990000'
}

function stdMenuOver(obj){
	obj.style.borderTop = 'solid 1px #FFCCCC'
	obj.style.borderLeft = 'solid 1px #FFCCCC'
	obj.style.borderRight = 'solid 1px #000000'
	obj.style.borderBottom = 'solid 1px #000000'
	obj.style.backgroundColor = '#FF0000'
	obj.style.color = '#FFFFCC'
}

function stdMenuOut(obj){
	obj.style.borderTop = 'solid 1px #CCCCCC'
	obj.style.borderLeft = 'solid 1px #CCCCCC'
	obj.style.borderRight = 'solid 1px #000000'
	obj.style.borderBottom = 'solid 1px #000000'
	obj.style.backgroundColor = '#000000'
	obj.style.color = '#FFFFFF'
}

function stdMenuDown(obj){
	obj.style.borderTop = 'solid 1px #000000'
	obj.style.borderLeft = 'solid 1px #000000'
	obj.style.borderRight = 'solid 1px #FFCCCC'
	obj.style.borderBottom = 'solid 1px #FFCCCC'
	obj.style.color = '#990000'
}

var fSize
fSize = 0

function upDateFontSize(val) {
	if (val == '0'){
		if (fSize < 0){
			val = fSize * -1
		}
		else if (fSize > 0){
			val = 0 - fSize
		}
	}
	fSize = parseInt(fSize) + parseInt(val)
	var s = document.styleSheets[0].cssRules || document.styleSheets[0].rules;

	for(var i=0, n=s.length; i<n; i++) {
		var z = s[i].selectorText;
		if (s[i].style.cursor == ""){
			if (s[i].style.fontSize != ""){
				s[i].style.fontSize = (parseInt(s[i].style.fontSize) + parseInt(val)) + "pt"
			}
		}
	}
	getElementsByClassName(document,"td", val)
}

function getElementsByClassName(oElm, strTagName, val){
	var arrElements = (strTagName == "*" && oElm.all)? oElm.all : oElm.getElementsByTagName(strTagName);
	var arrReturnElements = new Array();
	var oElement;
	for(var i=0; i<arrElements.length; i++){
		oElement = arrElements[i];
		arrReturnElements.push(oElement);
	}
	
	for(i=0;i<arrReturnElements.length;i++){
		if (arrReturnElements[i].style.cursor == ""){
			if (arrReturnElements[i].style.fontSize != ""){
				arrReturnElements[i].style.fontSize = (parseInt(arrReturnElements[i].style.fontSize) + parseInt(val)) + "pt"
			}
		}
	}

}

function showGalleryPage(catId){
	document.galleryFrm.pId.value = document.mMenu.pId.value
	document.galleryFrm.cId.value = catId
	document.galleryFrm.submit()
}

function scrollChange(){
	if (String(eval("document" + myAll + "overlay")) != "undefined"){
		if (eval("document" + myAll + "overlay" + myStyles + ".visibility") == "visible"){
			getPageSizeWithScroll()
		}
	}
}
function getPageSizeWithScroll(){
	
	if (window.innerHeight && window.scrollMaxY) {// Firefox
		yWithScroll = window.innerHeight + window.scrollMaxY;
		xWithScroll = window.innerWidth + window.scrollMaxX;
	}
	else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
		yWithScroll = document.body.scrollHeight;
		xWithScroll = document.body.scrollWidth;
	}
	else { // works in Explorer 6 Strict, Mozilla (not FF) and Safari
		yWithScroll = document.body.offsetHeight;
		xWithScroll = document.body.offsetWidth;
	}
	eval("document" + myAll + "overlay" + myStyles + ".height='" + yWithScroll + "'")
	eval("document" + myAll + "overlay" + myStyles + ".width='" + xWithScroll + "'")
	
	arrayPageSizeWithScroll = new Array(xWithScroll,yWithScroll);

    	return arrayPageSizeWithScroll;
}

