function NewWindow(mypage, myname, w, h, scroll) {
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;
	winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars=1,resizable'
	win = window.open(mypage, myname, winprops)
		if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}

function changePage() { 
	if (self.parent.frames.length != 0 && self.parent.location.toString().indexOf('matchifieds.com') < 0) 
		self.parent.location=document.location; 
} 

function isNum(entry) {
	var str = entry.value;
	for (var i = 0; i < str.length; i++) {
		var ch = str.substring(i, i + 1);
		if ((ch < "0" || "9" < ch)) {
			if(ch != "."){
				return false;
			}
		}
	}
	return true;
}

function isNumVal(entry) {
	var str = entry;
	for (var i = 0; i < str.length; i++) {
		var ch = str.substring(i, i + 1);
		if ((ch < "0" || "9" < ch)) {
			if(ch != "."){
				return false;
			}
		}
	}
	return true;
}



function round(num, d) { 
   n = Math.pow(10, !d ? 2 : d);
   return Math.round(num*n) / n;
 
}

function twoDigit(n) {
	var str=(n-1+1.005).toString();
	return str.substring(0,str.indexOf('.')+3);
}

function isPhone(entry) {
	var count=0;
	var str = entry.value;
	for (var i = 0; i < str.length; i++) {
		var ch = str.substring(i, i + 1);
		if ((ch >= "0" || "9" <= ch)) {
			count++;
		}
	}
	if (count >= 10){
		return true;
	}else{
		return false;
	}
}


function echeck(str) {
	var at="@"
	var dot="."
	var lat=str.indexOf(at)
	var lstr=str.length
	var ldot=str.indexOf(dot)
	if (str.indexOf(at)==-1){
	  
	   return false
	}

	if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
	  
	   return false
	}

	if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
	   
		return false
	}

	 if (str.indexOf(at,(lat+1))!=-1){
	   
		return false
	 }

	 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
	   
		return false
	 }

	 if (str.indexOf(dot,(lat+2))==-1){
	   
		return false
	 }
	
	 if (str.indexOf(" ")!=-1){
	   
		return false
	 }

	 return true					
}








//preload images
	        //SET STEP FOR EVERY ONE OF THE 3 PICTURES
			var step= new Array()
			step[1] = 1;
			step[2] = 1;
			step[3] = 1;
			step[4] = 1;

	        //SET WHICHIMAGE FOR EVERY ONE OF THE 3 PICTURES
			var whichimage= new Array()
			whichimage[1] = 1;
			whichimage[2] = 1;
			whichimage[3] = 1;
			whichimage[4] = 1;
			//=================================================================

			//SET LINKS, TITLES, DESCRIPTIONS AND PRELOAD PICTURES OF MAIN PIC #1
			
			

			function slideit(num_images){
				if (!document.images) { return; }
				for (var i=1;i <= num_images; i++){
					slide = eval("document.images.pic" + i);
				  //	slide.height=180;
				  //	slide.width=200;

					if (document.all) { slide.filters.blendTrans.apply(); }

					slide.src=eval("shirtImg"+i+"["+(step[i]-1)+"].src")

					if (document.all) slide.filters.blendTrans.play()

					whichimage[i] = step[i]
					
					steps = eval("pic"+ i + ".length");
					if (step[i] < steps) {
						step[i]++;
					} else {
						step[i] = 1;
					}
				}
				setTimeout("slideit("+num_images+")",6000);
			}
			
			
			
		
			
			


 



