
//javascript functions

// Browser Sniffer
v3 = 0; op = 0; ie4  = 0; ie5 = 0; nn4 = 0; nn6 = 0; isMac = 0; aol = 0;

if(document.images){
    if(navigator.userAgent.indexOf("Opera") != -1){
        op = 1;
    } else {
        if(navigator.userAgent.indexOf("AOL") != -1){
            aol = 1;
        } else {
            ie4 = (document.all && !document.getElementById);
            nn4 = (document.layers);
            ie5 = (document.all && document.getElementById);
            nn6 = (document.addEventListener);
        }
    }
} else {
    v3 = 1;	
}

function popUp(url) {
sealWin=window.open(url,"win",'toolbar=0,location=0,directories=0,status=1,menubar=1,scrollbars=1,resizable=1,width=500,height=450');
self.name = "mainWin";
}
                  
function Launch_Window(url,h,w){
	window.open(url,'new','HEIGHT='+ h +',WIDTH='+ w +',SCROLLBARS=YES,RESIZABLE=YES') 
}

function popUp(url) {
sealWin=window.open(url,"win",'toolbar=0,location=0,directories=0,status=1,menubar=1,scrollbars=1,resizable=1,width=500,height=450');
self.name = "mainWin";
}
                  
function brand(value){
	if (value != 0){
		document.form_1.category_id.selectedIndex = 0;
		document.form_1.keyword_search.value = "";
		document.form_1.submit();
	}
}

function category(value){
	if (value != 0){
		//document.form_1.brand_id.selectedIndex = 0;
		document.form_1.keyword_search.value = "";
		document.form_1.submit();
	}
}

function Paging(link, value){
	document.location.href = link + "&pg=" + value
}

function ShowPicture(file,h,w){
	var url = "product_image.asp?file=" + file
	window.open(url,'new','HEIGHT='+ h +',WIDTH='+ w +',RESIZABLE=YES') 
}

function validate_email (e) {

	var pattern;

	pattern = "[\\w\.-]+@[\\w\.-]+\.[a-zA-Z]";
	var regExp = new RegExp(pattern);
	if (!regExp.test(e.value)) {
		alert("Please enter a valid email address.");
		e.select();
		return false;
	}
}
