<!--//by monkeymind

// full url to root dir
var vPrefix = 'images/';//'http://www.montageweb.com/';
 

var nav_images = new Array(5);
  

if(document.images)
{
   for(var i=0; i < nav_images.length; i++) {
      //set up menu
      nav_images[i] = new Object();
      nav_images[i].over = new Image();
      nav_images[i].out  = new Image();

      nav_images[i].over.src = vPrefix + 'nav_' + (i) + '_roll.gif';
      nav_images[i].out.src = vPrefix + 'nav_' + (i) + '.gif';
   }
}


/*************************************************************************
SUB: switch_img
PARAMS: takes the img image name, or index, to effect and the name of the image to switch to.
RETURNS: void
**************************************************************************/
function switch_img( name, img )
{    
	if(document.images) 
   {
		// find by name
      var command = 'document.' + name + '.src=' + img + '.src';
      
      // find by image index
      //var command = 'document.images[' + name + '].src=' + img + '.src';
      //alert(command);
		eval(command);        
	}
} 


function newWindow(loc,w,h,scroll,resize) {
   	if(scroll == '') {scroll = 'no';}
	if(resize == '') {resize = 'no';}
   	var info = "\'toolbar=no,location=no,scrollbars=" + scroll + ",resizable="+ resize +",width=" + w + ",height=" + h + "\'"
   
   	var win = window.open(loc,'Detail',info)
   	win.focus();

}

/**************************************************************
get_url_parameters() - returns an object of the name value pairs
passed as url parameters.  To access the object use the '.' 
operator. 
ex:
	var params = get_url_parameters();
	alert( params.name_of_param_you_want );

WARNING: This version does not handle for duplicate names.
**************************************************************/
function get_url_parameters() {

	// create our object and get the url params
	var parameter_object = new Object();
	var url_string       = location.search.substring(1);
	var name_value_pairs = url_string.split("&");
	
	// split up the name/value pairs and store in the object
	var ctr;
	for( ctr = 0 ; ctr < name_value_pairs.length; ctr++ ) {
		
		var name_and_value = name_value_pairs[ctr].split("="); 
		var param_name   = name_and_value[0];
		var param_value  = name_and_value[1];
		
		parameter_object[ unescape(param_name) ] = unescape( param_value );
	}
	  
	return parameter_object;
} // end get_url_parameters()


// taken from oreilly's javascript book p.245
function get_args() {
   var args = new Object();
   //get the query string
   var query = location.search.substring(1);
   //split at commas
   var pairs = query.split("&");
   for(var i = 0; i < pairs.length; i++){
      //look for name=value pairs
      var pos = pairs[i].indexOf('=');
      //skip if we don't find
      if(pos == -1) continue;
      //extract the name
      var argname = pairs[i].substring(0,pos);
      //extract the value
      var value = pairs[i].substring(pos+1);
      args[argname] = unescape(value);
      
   }
   return args;
}


function getCookieVal (offset) {
   var endstr = document.cookie.indexOf (";", offset);
   if (endstr == -1)
      endstr = document.cookie.length;
   return unescape(document.cookie.substring(offset, endstr));
}
function GetCookie (name) {
        var arg = name + "=";
        var alen = arg.length;
        var clen = document.cookie.length;
        var i = 0;
        while (i < clen) {
                var j = i + alen;
                if (document.cookie.substring(i, j) == arg)
                        return getCookieVal (j);
                i = document.cookie.indexOf(" ", i) + 1;
                        if (i == 0)
                                break;
                }
   return null;
}
function SetCookie (name, value) {
        var argv = SetCookie.arguments;
        var argc = SetCookie.arguments.length;
        var expires = (argc > 2) ? argv[2] : null;
        var path = (argc > 3) ? argv[3] : '/';
        var domain = (argc > 4) ? argv[4] : 'atlantisweathergear.com';
        var secure = (argc > 5) ? argv[5] : false;
        document.cookie = name + "=" + escape (value) +
                ((expires == null) ? "" : ("; expires=" +
expires.toGMTString())) +
                ((path == null) ? "" : ("; path=" + path)) +
                ((domain == null) ? "" : ("; domain=" + domain)) +
                ((secure == true) ? "; secure" : "");
}



function deleteCookie( name, path, domain ) {
  if ( GetCookie( name ) ) document.cookie = name + "=" +
    ( ( path ) ? ";path=" + path : "") +
    ( ( domain ) ? ";domain=" + domain : "" ) +
    ";expires=Thu, 01-Jan-1970 00:00:01 GMT";
}


function product_roll( id, src, color )
{    
	if(document.images) 
   {
		// find by id
		var img = '';
		var mySrc = new String(src);
		mySrc = mySrc.replace(/graphics\/00000001\//,'images\/');
		//mySrc = mySrc.replace(/_D\.jpg/,'');
		if(!color){
			mySrc = mySrc.replace(/\.jpg/,'');
			img = mySrc + '.jpg';
			//alert(img);
		}
		else{
			mySrc = mySrc.replace(/_D\.jpg/,'');
			img = mySrc + '_' + color + '.jpg';	
			//alert(img);
		}
		
		//alert(img);
      	var command = 'document.getElementById("' + id + '").src="' + img + '"';


      	// find by image index
      	//var command = 'document.images[' + name + '].src=' + img + '.src';
      	//alert(command);
	  	eval(command);        
	}
}

function icon_roll( id, src, color )
{    
	if(document.images) 
   {
		// find by id
		var img = '';
		var mySrc = new String(src);
		color = color.toLowerCase();
		mySrc = mySrc.replace(/graphics\/00000001\//,'images\/');
			if(mySrc.indexOf('.gif') != -1)
			{
				mySrc = mySrc.replace(/_...\.gif/,'_');
				img = mySrc + color + '.gif';
			}
			else
			{
				mySrc = mySrc.replace(/_...\.jpg/,'_');
				img = mySrc + color + '.jpg';	
			}
			//alert(img);
		
		//alert(img);
      	var command = 'document.getElementById("' + id + '").src="' + img + '"';


      	// find by image index
      	//var command = 'document.images[' + name + '].src=' + img + '.src';
      	//alert(command);
	  	eval(command);        
	}
}

// fields ending with '_req' are required fields             
function check_form(form) {
	
for(var z=0 ; z < form.elements.length ; z++)
{
	if( form.elements[z].type == "hidden" ) { continue; }
	if( form.elements[z].name == "website"){ continue; }
	if( form.elements[z].name == "imageFile"){ continue;}
   	if(form.elements[z].value == "")//&& form.elements[z].name.indexOf('_req') != -1 )
  	{
    	alert("The Field \" " + form.elements[z].name + " \" is a required field.");
    	return false;
 	} 
}

	return( true );
}


//--> 