//----------------------------------------------------
// These Scripts added by Noor Thapa
//----------------------------------------------------
// This is the Tips Portion
// Add/Edit/Delete as you want in an array
//----------------------------------------------------
var ntPopup = window.createPopup();
var title = new Array()
var text = new Array()
//---------------------------------------------
// Tip Number 1 & 2 . Add more to array as 
// needed. Just increase the number as you do.
//---------------------------------------------
title[1] = "Web Design"
text[1] ="We are the largest and oldest Web design firm in Staten Island"
title[2] = "Web Application Development"
text[2] ="We Develop and manage web applications"
//---------------------------------------------
// Actual Function
//--------------------------------------------
function showTip(num) {
	var popupBody = ntPopup.document.body;
	ntPopup.document.body.innerHTML = "<table cellpadding='1' cellspacing='0' border='0' width='200' style='border: 1px solid Black'><tr><td style='background-color: Black; font-family: tahoma, arial, helvetica; font-size: 10px;'><b><font color=white> " + title[num] + "</font></b></td></tr><tr><td style='background-color: Yellow; font-family: tahoma, arial, helvetica; font-size: 10px;'>" + text[num] +"</td></tr></table>";
	ntPopup.show(0, 0, 0, 0);
	var realHeight = popupBody.scrollHeight, realWidth = popupBody.scrollWidth;
	ntPopup.hide();
	if (realWidth < event.srcElement.clientWidth) {
		realWidth = event.srcElement.clientWidth;
		ntPopup.document.body.children[0].style.width = realWidth;
	}
	ntPopup.show(20, 10, realWidth, realHeight, event.srcElement);
}
//----------------------------------------------------
// Form Validation Routines.
// Currently has Phone and password match
//----------------------------------------------------
var digits = "0123456789";
var phoneNumberDelimiters = "()- ";
var validWorldPhoneChars = phoneNumberDelimiters + "+";
var minDigitsInIPhoneNumber = 10;
function isInteger(s)
{   var i;
    for (i = 0; i < s.length; i++)
    {   
        var c = s.charAt(i);
        if (((c < "0") || (c > "9"))) return false;
    }
    return true;
}
function stripCharsInBag(s, bag)
{   var i;
    var returnString = "";
    for (i = 0; i < s.length; i++)
    {   
        var c = s.charAt(i);
        if (bag.indexOf(c) == -1) returnString += c;
    }
    return returnString;
}
function checkInternationalPhone(strPhone){
s=stripCharsInBag(strPhone,validWorldPhoneChars);
return (isInteger(s) && s.length >= minDigitsInIPhoneNumber);
}

function NTcheckForm() {
	var phone=document.frmSample.phone
	if ((phone.value==null)||(phone.value=="")){
		alert("Please Enter your Phone Number")
		phone.focus()
		return false
	}
	if (checkInternationalPhone(phone.value)==false){
		alert("Please Enter a Valid Phone Number")
		phone.value=""
		phone.focus()
		return false
	}
	pw1 = form.password.value;
	pw2 = form.password2.value;
	if (pw1 != pw2) {
		alert ("Your passwords do not match ! \n Please re-enter your password.")
		password.focus()
		return false;
	}
	return true
 }

//----------------------------------------------------
// This is the BookMark portion
// Add/Edit/Delete as you want in an array
//----------------------------------------------------
function addbookmark()
{
bookmarkurl="http://www.mindsaw.com"
bookmarktitle="Staten Island Web Design"
if (document.all)
window.external.AddFavorite(bookmarkurl,bookmarktitle)
}



//----------------------------------------------------
// This is the Open Image portion
// This Function will create a new window
// and resize that window to the image 
// it is holding. Useful to use for galleries
// that need popup windows to display
// images when clicked on the thumbnails
//----------------------------------------------------
PositionX = 100;
PositionY = 100;
defaultWidth  = 500;
defaultHeight = 500;
var AutoClose = true;

// Do not edit below this line...
//-------------------------------------------- 
if (parseInt(navigator.appVersion.charAt(0))>=4){
var isNN=(navigator.appName=="Netscape")?1:0;
var isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}
var optNN='scrollbars=no,width='+defaultWidth+',height='+defaultHeight+',left='+PositionX+',top='+PositionY;
var optIE='scrollbars=no,width=150,height=100,left='+PositionX+',top='+PositionY;
function NTpopImage(imageURL,imageTitle){
	if (isNN){imgWin=window.open('about:blank','',optNN);}
	if (isIE){imgWin=window.open('about:blank','',optIE);}
		with (imgWin.document){
			writeln('<html><head><title>Loading...</title><style>body{margin:0px;}</style>');writeln('<sc'+'ript>');
			writeln('var isNN,isIE;');writeln('if (parseInt(navigator.appVersion.charAt(0))>=4){');
			writeln('isNN=(navigator.appName=="Netscape")?1:0;');writeln('isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}');
			writeln('function reSizeToImage(){');writeln('if (isIE){');writeln('window.resizeTo(100,100);');
			writeln('width=100-(document.body.clientWidth-document.images[0].width);');
			writeln('height=100-(document.body.clientHeight-document.images[0].height);');
			writeln('window.resizeTo(width,height);}');writeln('if (isNN){');       
			writeln('window.innerWidth=document.images["NThapa"].width;');writeln('window.innerHeight=document.images["NThapa"].height;}}');
			writeln('function doTitle(){document.title="'+imageTitle+'";}');writeln('</sc'+'ript>');
		if (!AutoClose) writeln('</head><body bgcolor=000000 scroll="no" onload="reSizeToImage();doTitle();self.focus()">')
		else 
			writeln('</head><body bgcolor=000000 scroll="no" onload="reSizeToImage();doTitle();self.focus()" onblur="self.close()">');
			writeln('<a href=javascript:close()><img border=0 name="LaDance" src='+imageURL+' style="display:block"></a></body></html>');
			close();		
		}}

