// JavaScript Document


var parent = new Array();
parent = location.href.split("?");
//if(parent[1].split("&") != null){
var variables = parent[1].split("&");
//document.write(variables.length);
if(variables.length >= 4){
//document.write("find wine name");
var url = location.href;
var flashvar = new Array();
flashvar = url.split("winename=");
var urlname = flashvar[1];
var wine = urlname.replace(/#/,"");
}
if(variables.length == 1){
var wine = "here";
}
//document.write(wine);
//}
//
function flash11()
{
document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="350" height="200">\n');
document.write('<param name="movie" value="swfs/winename.swf?myVar=' + wine + '">\n');
document.write('<param name="quality" value="high">\n');
document.write('<param name="wmode" value="transparent"/>\n');
document.write('<embed src="swfs/winename.swf?myVar=' + wine + '" quality="high" wmode="transparent" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="350" height="200"></embed>\n');
document.write('</object>\n');
}
function flash12()
{
document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="490" height="400">\n');
document.write('<param name="movie" value="swfs/image-gallery-our-club-family.swf">\n');
document.write('<param name="quality" value="high">\n');
document.write('<param name="wmode" value="transparent"/>\n');
document.write('<embed src="swfs/image-gallery.swf" wmode="transparent" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="490" height="400"></embed>\n');
document.write('</object>\n');
}
function flash13()
{
document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="490" height="400">\n');
document.write('<param name="movie" value="swfs/image-gallery-online-tour.swf">\n');
document.write('<param name="quality" value="high">\n');
document.write('<param name="wmode" value="transparent"/>\n');
document.write('<embed src="swfs/image-gallery-online-tour.swf" wmode="transparent" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="490" height="400"></embed>\n');
document.write('</object>\n');
}
function flash14()
{
document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="490" height="400">\n');
document.write('<param name="movie" value="swfs/image-gallery-our-story.swf">\n');
document.write('<param name="quality" value="high">\n');
document.write('<param name="wmode" value="transparent"/>\n');
document.write('<embed src="swfs/image-gallery-our-story.swf" wmode="transparent" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="490" height="400"></embed>\n');
document.write('</object>\n');
}
function flash15()
{
document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="490" height="400">\n');
document.write('<param name="movie" value="swfs/image-gallery-dinner-theatre.swf">\n');
document.write('<param name="quality" value="high">\n');
document.write('<param name="wmode" value="transparent"/>\n');
document.write('<embed src="swfs/image-gallery-dinner-theatre.swf" wmode="transparent" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="490" height="400"></embed>\n');
document.write('</object>\n');
}
function flash16()
{
document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="490" height="400">\n');
document.write('<param name="movie" value="swfs/image-gallery-bistro.swf">\n');
document.write('<param name="quality" value="high">\n');
document.write('<param name="wmode" value="transparent"/>\n');
document.write('<embed src="swfs/image-gallery-bistro.swf" wmode="transparent" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="490" height="400"></embed>\n');
document.write('</object>\n');
}

function updateMouseCoordinates(e){
  
}

var calendarBoolean=new Boolean();

function overevent(box){
	calendarBoolean = true;
}
function outevent(box){
	calendarBoolean = false;
}

function blurText(box)
			{
			 document.getElementById('eventbox'+box).style.backgroundColor = "#ffffff";
			 // remove the event to stop an infinite loop!
			 //window.onblur = '';
			}
var elem = null;

function showevent(box,e){
	
	if(calendarBoolean != true){
		if(isIE && isWin && !isOpera) {
			
			var posx = 0;
			var posy = 0;
			if (!e) var e = window.event;
			if (e.pageX || e.pageY) 	{
				posx = e.pageX;
				posy = e.pageY;
			}
			else if (e.clientX || e.clientY) 	{
				posx = e.clientX + document.body.scrollLeft
					+ document.documentElement.scrollLeft;
				posy = e.clientY + document.body.scrollTop
					+ document.documentElement.scrollTop;
			}
			
			
			if (parseInt(navigator.appVersion)>3) {
				 if (navigator.appName=="Netscape") {
					  winW = window.innerWidth;
					  winH = window.innerHeight;
				 }
				 if (navigator.appName.indexOf("Microsoft")!=-1) {
					  winW = document.body.offsetWidth;
					  winH = document.body.offsetHeight;
				 }
			}
			
			if(posx > ((winW/2))){
				//alert('here');
				var ebox = document.getElementById('eventbox'+box);
				//alert(ebox.style.display);
				//ebox.style.border = '1px solid black';
				ebox.style.display = 'block';
				ebox.style.position = 'absolute';
				ebox.style.zIndex = 20;
				ebox.style.top = posy;
				ebox.style.left = posx-300;
				ebox.style.width = "300px";
				ebox.style.height = "auto";
				ebox.style.backgroundColor = "#c59e7e";
				
			}else{
				var ebox = document.getElementById('eventbox'+box);
				//alert(ebox.style.display);
				//ebox.style.border = '1px solid black';
				ebox.style.display = 'block';
				ebox.style.position = 'absolute';
				ebox.style.zIndex = 20;
				ebox.style.top = posy;
				ebox.style.left = posx;
				ebox.style.width = "300px";
				ebox.style.height = "auto";
				ebox.style.backgroundColor = "#c59e7e";
			}
		}else{
			
			


			elem = document.getElementById('eventtd'+box);
			// NOTE: doEvent(); or doEvent(param); will NOT work here.
			// Must be a reference to a function name, not a function call.
			//document.getElementById('eventtd'+box).addEventListener('mouseout', hideevent2(box), false);

			elem.onFocus = hideevent2(box);
			
			var posx = 0;
			var posy = 0;
			if (!e) var e = window.event;
			if (e.pageX || e.pageY) 	{
				posx = e.pageX;
				posy = e.pageY;
			}
			else if (e.clientX || e.clientY) 	{
				posx = e.clientX + document.body.scrollLeft
					+ document.documentElement.scrollLeft;
				posy = e.clientY + document.body.scrollTop
					+ document.documentElement.scrollTop;
			}
			//alert(posy);
			if (parseInt(navigator.appVersion)>3) {
				 if (navigator.appName=="Netscape") {
					  winW = window.innerWidth;
					  winH = window.innerHeight;
				 }
				 if (navigator.appName.indexOf("Microsoft")!=-1) {
					  winW = document.body.offsetWidth;
					  winH = document.body.offsetHeight;
				 }
			}
			
			if(posx > ((winW/2))){
				var ebox = document.getElementById('eventbox'+box);
				ebox.style.display = 'block';
				ebox.style.position = 'absolute';
				ebox.style.zIndex = 5;
				ebox.style.top = posy+"px";
				ebox.style.left = posx-300+"px";
				ebox.style.width = "300px";
				ebox.style.height = "auto";
				ebox.style.backgroundColor = "#c59e7e";
			}else{
				var ebox = document.getElementById('eventbox'+box);
				ebox.style.display = 'block';
				ebox.style.position = 'absolute';
				ebox.style.zIndex = 5;
				ebox.style.top = posy+"px";
				ebox.style.left = posx+"px";
				ebox.style.width = "300px";
				ebox.style.height = "auto";
				ebox.style.backgroundColor = "#c59e7e";
			}
			
			//alert('here1');
			//var elem = null;


			//elem = document.getElementById('eventtd'+box);
			// NOTE: doEvent(); or doEvent(param); will NOT work here.
			// Must be a reference to a function name, not a function call.
			//document.getElementById('eventtd'+box).addEventListener('mouseout', hideevent2(box), false);

			//ebox.onBlur = hideevent2(box);

			


			
			
			
		}
		
	}
	
}
function hideevent2(box){
	//alert(box);
}
function closeevent(box){
	var ebox = document.getElementById('eventbox'+box);
			
	ebox.style.position = 'relative';
	ebox.style.zIndex = 0;
	ebox.style.top = 0;
	ebox.style.left = 0;
	ebox.style.width = "59px";
	ebox.style.backgroundColor = "inherit";
	ebox.style.display = 'none';
}
function hideevent(box){
	
	if(calendarBoolean != true){
		
		if(isIE && isWin && !isOpera) {
			var ebox = document.getElementById('eventbox'+box);
			//alert(box);
			//ebox.style.border = '1px solid black';
			
			ebox.style.position = 'relative';
			ebox.style.zIndex = 0;
			ebox.style.top = 0;
			ebox.style.left = 0;
			ebox.style.width = "59px";
			ebox.style.backgroundColor = "inherit";
			ebox.style.display = 'none';
		}else{
			
			var ebox = document.getElementById('eventbox'+box);
			
			ebox.style.position = 'relative';
			ebox.style.zIndex = 0;
			ebox.style.top = 0;
			ebox.style.left = 0;
			ebox.style.width = "59px";
			ebox.style.backgroundColor = "inherit";
			ebox.style.display = 'none';
		}
	}else{
		
	}
	
}
function shownoevent(){
	//alert('here');
}

var isIE  = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;
function ControlVersion()
{
	var version;
	var axo;
	var e;
	// NOTE : new ActiveXObject(strFoo) throws an exception if strFoo isn't in the registry
	try {
		// version will be set for 7.X or greater players
		axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
		version = axo.GetVariable("$version");
	} catch (e) {
	}
	if (!version)
	{
		try {
			// version will be set for 6.X players only
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
			
			// installed player is some revision of 6.0
			// GetVariable("$version") crashes for versions 6.0.22 through 6.0.29,
			// so we have to be careful. 
			
			// default to the first public version
			version = "WIN 6,0,21,0";
			// throws if AllowScripAccess does not exist (introduced in 6.0r47)		
			axo.AllowScriptAccess = "always";
			// safe to call for 6.0r47 or greater
			version = axo.GetVariable("$version");
		} catch (e) {
		}
	}
	if (!version)
	{
		try {
			// version will be set for 4.X or 5.X player
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
			version = axo.GetVariable("$version");
		} catch (e) {
		}
	}
	if (!version)
	{
		try {
			// version will be set for 3.X player
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
			version = "WIN 3,0,18,0";
		} catch (e) {
		}
	}
	if (!version)
	{
		try {
			// version will be set for 2.X player
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
			version = "WIN 2,0,0,11";
		} catch (e) {
			version = -1;
		}
	}
	
	return version;
}
// JavaScript helper required to detect Flash Player PlugIn version information
function GetSwfVer(){
	// NS/Opera version >= 3 check for Flash plugin in plugin array
	var flashVer = -1;
	
	if (navigator.plugins != null && navigator.plugins.length > 0) {
		if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
			var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
			var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;
			var descArray = flashDescription.split(" ");
			var tempArrayMajor = descArray[2].split(".");			
			var versionMajor = tempArrayMajor[0];
			var versionMinor = tempArrayMajor[1];
			var versionRevision = descArray[3];
			if (versionRevision == "") {
				versionRevision = descArray[4];
			}
			if (versionRevision[0] == "d") {
				versionRevision = versionRevision.substring(1);
			} else if (versionRevision[0] == "r") {
				versionRevision = versionRevision.substring(1);
				if (versionRevision.indexOf("d") > 0) {
					versionRevision = versionRevision.substring(0, versionRevision.indexOf("d"));
				}
			}
			var flashVer = versionMajor + "." + versionMinor + "." + versionRevision;
		}
	}
	// MSN/WebTV 2.6 supports Flash 4
	else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;
	// WebTV 2.5 supports Flash 3
	else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;
	// older WebTV supports Flash 2
	else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;
	else if ( isIE && isWin && !isOpera ) {
		flashVer = ControlVersion();
	}	
	return flashVer;
}
// When called with reqMajorVer, reqMinorVer, reqRevision returns true if that version or greater is available
function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision)
{
	versionStr = GetSwfVer();
	if (versionStr == -1 ) {
		return false;
	} else if (versionStr != 0) {
		if(isIE && isWin && !isOpera) {
			// Given "WIN 2,0,0,11"
			tempArray         = versionStr.split(" "); 	// ["WIN", "2,0,0,11"]
			tempString        = tempArray[1];			// "2,0,0,11"
			versionArray      = tempString.split(",");	// ['2', '0', '0', '11']
		} else {
			versionArray      = versionStr.split(".");
		}
		var versionMajor      = versionArray[0];
		var versionMinor      = versionArray[1];
		var versionRevision   = versionArray[2];
        	// is the major.revision >= requested major.revision AND the minor version >= requested minor
		if (versionMajor > parseFloat(reqMajorVer)) {
			return true;
		} else if (versionMajor == parseFloat(reqMajorVer)) {
			if (versionMinor > parseFloat(reqMinorVer))
				return true;
			else if (versionMinor == parseFloat(reqMinorVer)) {
				if (versionRevision >= parseFloat(reqRevision))
					return true;
			}
		}
		return false;
	}
}
function AC_AddExtension(src, ext)
{
  if (src.indexOf('?') != -1)
    return src.replace(/\?/, ext+'?'); 
  else
    return src + ext;
}
function AC_Generateobj(objAttrs, params, embedAttrs) 
{ 
  var str = '';
  if (isIE && isWin && !isOpera)
  {
    str += '<object ';
    for (var i in objAttrs)
    {
      str += i + '="' + objAttrs[i] + '" ';
    }
    str += '>';
    for (var i in params)
    {
      if(i == 'movie'){
		  //alert(params['videosrc']);
	  	  str += '<param name="' + i + '" value="' + params[i] + '?videosrc='+params['videosrc']+'&videowidth='+objAttrs['width']+'&videoheight='+objAttrs['height']+'&videoskin='+params['videoskin']+'" /> ';
	  }else{
		  //alert(i);
		  str += '<param name="' + i + '" value="' + params[i] + '" />';
	  }
    }
    str += '</object>';
  }
  else
  {
	
    str += '<embed ';
    for (var i in embedAttrs)
    {
      
	  	str += i + '="' + embedAttrs[i]  + '" ';
	  
    }
    str += '> </embed>';
  }
  //alert(str);
  document.write(str);
}
function AC_FL_RunContent(){
  var ret = 
    AC_GetArgs
    (  arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
     , "application/x-shockwave-flash"
    );
  AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
}
function AC_SW_RunContent(){
  var ret = 
    AC_GetArgs
    (  arguments, ".dcr", "src", "clsid:166B1BCA-3F9C-11CF-8075-444553540000"
     , null
    );
  AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
}
function AC_GetArgs(args, ext, srcParamName, classid, mimeType){
  var ret = new Object();
  ret.embedAttrs = new Object();
  ret.params = new Object();
  ret.objAttrs = new Object();
  for (var i=0; i < args.length; i=i+2){
    var currArg = args[i].toLowerCase();    
    switch (currArg){	
      case "classid":
        break;
      case "pluginspage":
        ret.embedAttrs[args[i]] = args[i+1];
        break;
      case "src":
      case "movie":	
        args[i+1] = AC_AddExtension(args[i+1], ext);
        ret.embedAttrs["src"] = args[i+1];
        ret.params[srcParamName] = args[i+1];
        break;
      case "onafterupdate":
      case "onbeforeupdate":
      case "onblur":
      case "oncellchange":
      case "onclick":
      case "ondblclick":
      case "ondrag":
      case "ondragend":
      case "ondragenter":
      case "ondragleave":
      case "ondragover":
      case "ondrop":
      case "onfinish":
      case "onfocus":
      case "onhelp":
      case "onmousedown":
      case "onmouseup":
      case "onmouseover":
      case "onmousemove":
      case "onmouseout":
      case "onkeypress":
      case "onkeydown":
      case "onkeyup":
      case "onload":
      case "onlosecapture":
      case "onpropertychange":
      case "onreadystatechange":
      case "onrowsdelete":
      case "onrowenter":
      case "onrowexit":
      case "onrowsinserted":
      case "onstart":
      case "onscroll":
      case "onbeforeeditfocus":
      case "onactivate":
      case "onbeforedeactivate":
      case "ondeactivate":
      case "type":
      case "codebase":
      case "id":
        ret.objAttrs[args[i]] = args[i+1];
        break;
      case "width":
      case "height":
      case "align":
      case "vspace": 
      case "hspace":
      case "class":
      case "title":
      case "accesskey":
      case "name":
      case "tabindex":
        ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];
        break;
      default:
        ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];
    }
  }
  ret.objAttrs["classid"] = classid;
  if (mimeType) ret.embedAttrs["type"] = mimeType;
  return ret;
}

///////////////////////////////////////
///////////////////////////////////////
///////////////////////////////////////
///////////////////////////////////////
///////////////////////////////////////

//New Store

///////////////////////////////////////
///////////////////////////////////////
///////////////////////////////////////
///////////////////////////////////////
///////////////////////////////////////
function Get_Cookie( name ) {

	var start = document.cookie.indexOf( name + "=" );
	var len = start + name.length + 1;
	if ( ( !start ) &&
	( name != document.cookie.substring( 0, name.length ) ) )
	{
	return null;
	}
	if ( start == -1 ) return null;
	var end = document.cookie.indexOf( ";", len );
	if ( end == -1 ) end = document.cookie.length;
	return unescape( document.cookie.substring( len, end ) );
}

function updateclothes(quan){
	
	if(document.getElementById("color")){
		var color = document.getElementById("color").value;
	}else{
		var color = "";
	}
	if(document.getElementById("size")){
		var size = document.getElementById("size").value;
	}else{
		var size = "";
	}
	
	var colorsize = color+""+size;
	var CArray = Get_Cookie('Clothes');
	var Clothes = CArray.split(",");
	
	for (var i=0;i<Clothes.length;i++) {
		var Clothes2;
		Clothes2 = Clothes[i].split("-");
		//alert(Clothes2[1]);
		if(color != undefined && size != undefined){
			if(Clothes2[0] == colorsize){
				//alert(Clothes2[2]);
				var addtocart = document.getElementById("buynowlink").href;
				var urlarray = addtocart.split("&");
				urlarray[3] = "LookupCode="+Clothes2[1];
				var newurl = urlarray.join("&");
				document.getElementById("dynamicsku").innerHTML = Clothes2[1];
				document.getElementById("productprice").innerHTML = "$"+Clothes2[2];
				document.getElementById("buynowlink").href = newurl;
			}
		}
		if(color == "" && size != undefined){
			//alert(size+" "+Clothes2[0]);
			if(Clothes2[0] == size){
				
				var addtocart = document.getElementById("buynowlink").href;
				var urlarray = addtocart.split("&");
				urlarray[3] = "LookupCode="+Clothes2[1];
				var newurl = urlarray.join("&");
				//alert(size.indexOf(Clothes2[0]));
				document.getElementById("dynamicsku").innerHTML = Clothes2[1];
				document.getElementById("buynowlink").href = newurl;
			}
		}
		if(color != undefined && size == ""){
			if(Clothes2[0] == color){
				var addtocart = document.getElementById("buynowlink").href;
				var urlarray = addtocart.split("&");
				urlarray[3] = "LookupCode="+Clothes2[1];
				var newurl = urlarray.join("&");
				document.getElementById("dynamicsku").innerHTML = Clothes2[1];
				document.getElementById("buynowlink").href = newurl;
			}
		}
		
	}
	
	
	//var urlarray = addtocart.split("&");
	//urlarray[3] = "LookupCode="+quan;
	//var newurl = urlarray.join("&");
	//alert(newurl);
	//document.getElementById("buynowlink").href = newurl;
	
}
function updatesku(quan){
	
	var addtocart = document.getElementById("buynowlink").href;
	var urlarray = addtocart.split("&");
	urlarray[3] = "LookupCode="+quan;
	var newurl = urlarray.join("&");
	//alert(newurl);
	document.getElementById("buynowlink").href = newurl;
	
}
function updatequantity(quan){
	
	var addtocart = document.getElementById("buynowlink").href;
	var urlarray = addtocart.split("&");
	urlarray[4] = "Quantity="+quan;
	var newurl = urlarray.join("&");
	//alert(newurl);
	document.getElementById("buynowlink").href = newurl;
	//alert(document.getElementById("buynowlink").href);
}
function updatemetadesc(){
	//alert('here');
	var content2 = document.getElementById('NewsPostDetailContent').innerHTML;
	content2 = content2.split(" ", 20);
	//alert(content.length);
	content2.join(" ");
	//return content2;
	//document.writeln("<meta name=\"description\" content=\"description content write\"/>");
    //alert(content2);
	var myLink = document.createElement('a'); 
	var href = document.createAttribute('href'); 
	myLink.setAttribute('href','http://www.afcc1.com'); 
	myLink.innerText ="Go here"; 
	var spanAppend = document.getElementById('NewsPostDetailContent'); 
	//spanAppend.appendChild(myLink); 

}


function displaymenu(value){
	document.getElementById("Top_nav_Id").style.display = value; 

}
function loadtabarea(info){
	//alert(info);
	document.getElementById("tab1area").style.display = 'none';
	document.getElementById("tab2area").style.display = 'none';
	document.getElementById("tab3area").style.display = 'none';
	document.getElementById(info).style.display = 'block';
	//alert(info);
	
}
function loadproductimage(image){
	//alert(document.getElementById("productlargeimage").src);
	document.getElementById("productlargeimage").src = "uploads/"+image;
	document.getElementById("productlargeimage").alt = "uploads/"+image.replace("large","largeZoom");
	
}

///////////////////////////////////////
///////////////////////////////////////
///////////////////////////////////////
///////////////////////////////////////
///////////////////////////////////////

//End New Store

///////////////////////////////////////
///////////////////////////////////////
///////////////////////////////////////
///////////////////////////////////////
///////////////////////////////////////

function gotomain(){
window.location="http://www.duplinwinery.com/";
}


// Copyright 2006-2007 javascript-array.com
var timeout	= 500;
var closetimer	= 0;
var ddmenuitem	= 0;
// open hidden layer
function mopen(id){	
// cancel close timer
//alert(id);
	mcancelclosetime();
// close old layer
	if(ddmenuitem) {
		ddmenuitem.style.display = 'none';
	}
	if(ddmenuitem2) {
		ddmenuitem2.style.display = 'none';
	}
// get new layer and show it
	ddmenuitem = document.getElementById(id);
	ddmenuitem.style.display = 'block';
}
// close showed layer
function mclose(){

	if(ddmenuitem) {
		ddmenuitem.style.display = 'none';
		ddmenuitem2.style.display = 'none';
		
	}
}
// go close timer
function mclosetime(){
	closetimer = window.setTimeout(mclose, timeout);
}
// cancel close timer
function mcancelclosetime(){
//alert('mcancelclosetime');
	if(closetimer){
		window.clearTimeout(closetimer);
		closetimer = null;
	}
}
var timeout2	= 500;
var closetimer2	= 0;
var ddmenuitem2	= 0;
// open hidden layer
function mopen2(id){	
// cancel close timer
//alert(id);
	mcancelclosetime2(id);
	document.getElementById(id).style.display = 'block';
// close old layer
	//if(ddmenuitem2 == id) {
	//	document.getElementById(id).style.display = 'block';
	//	ddmenuitem2 = id;
	//}else{
	//	ddmenuitem2.style.display = 'none';
	//	ddmenuitem2 = id;
	//}
	
}

// close showed layer
function mclose2(id){
//alert('mclose2');
	document.getElementById(id).style.display = 'none';
	//if(ddmenuitem2) {
		//ddmenuitem2.style.display = 'none';
	//}
}
// go close timer
function mclosetime2(){
	closetimer2 = window.setTimeout(mclose2, timeout2);
}
// cancel close timer
function mcancelclosetime2(){
	if(closetimer2){
		window.clearTimeout(closetimer2);
		closetimer2 = null;
	}
}



var timeout2	= 500;
var closetimer2	= 0;
var ddmenuitem2	= 0;
// open hidden layer
function spanopen2(id,parent){	
// cancel close timer
//alert(id);
	mcancelclosetime2();
// close old layer
	if(ddmenuitem2) {
		///ddmenuitem2.style.display = 'none';
	}
// get new layer and show it
	ddmenuitem3 = document.getElementById(parent);
	ddmenuitem3.style.display = 'block';
	ddmenuitem2 = document.getElementById(id);
	ddmenuitem2.style.display = 'block';
}

// close showed layer
function spanclose2(){
//alert('mclose2');
	if(ddmenuitem2) {
		ddmenuitem2.style.display = 'none';
	}
}
// go close timer
function spanclosetime2(){
	closetimer2 = window.setTimeout(mclose2, timeout2);
}
// cancel close timer
function spancancelclosetime2(){
	if(closetimer2){
		window.clearTimeout(closetimer2);
		closetimer2 = null;
	}
}
// close layer when click-out
//document.onclick = mclose; 
//document.onclick = mclose2; 




//Pop up Function
function popup(id,title){

document.open("php/pop.php?id="+id+"&producttitle="+title+"","myWindow","status=1, width = 750,height=600,resizable=0");
//alert(id);
}
function popup2(id){
//alert("pop");
document.open("php/pop2.php?id=" + id + "", "myWindow", "status = 1, width = 750, height=600, resizable = 0");
}

/* Error messages for possible errors */
var error_address_empty 	= 'Please enter a valid address first.';
var error_invalid_address 	= 'This address is invalid.';
var error_google_error 		= 'There was a problem processing your request, please try again.';
var error_no_map_info		= 'Sorry! Map information is not available for this address.';
/* The default address of your store (your main office or store maybe), we will display this address on the map on startup */
/* Edit this */
var default_address = '1600 Amphitheatre Parkway, Mountain View, CA  94043';
var current_address = null; /* Current address we are displaying, we save it here for directions */
var map				  = null; /* Instance of Google Maps object */
var geocoder		  = null; /* Instance of Google Deocoder object */
var gdir				  = null; /* Instance of Google Directions object */
var map_compatible  = false; /* Whether or not user's browser is compatible to show the map */
/* Check if the browser is compatible */
/* Initialize the map this will be called when the document is loaded from: <body onLoad="initialize_map();"> */
function initialize_map() {
if(GBrowserIsCompatible()) {
var map_compatible = true;
//alert(map_compatible);
}
if( map_compatible ) {
var map = new GMap2(document.getElementById('map'));        
var geocoder = new GClientGeocoder();
var marker = new GMarker(new GLatLng(34.830401262867504, -78.02392601966858));
var html = '<div style="width:210px; padding-right:10px;"><img src="uploads/images/_logos/small_map_logo.jpg" ></div>';
show_address(default_address);
map.setCenter(new GLatLng(34.830401262867504, -78.02392601966858), 9);
map.addOverlay(marker);
//var boundaries = new GLatLngBounds(new GLatLng(34.830401262867504, -78.02392601966858), new GLatLng(35.830401262867504, -79.02392601966858));
//var oldmap = new GGroundOverlay("uploads/images/_logos/small_map_logo.jpg", boundaries);
//map.addOverlay(oldmap);
//marker.openInfoWindowHtml(html);
map.addControl(new GLargeMapControl());
map.addControl(new GMapTypeControl());
}
}
function initialize_map2() {
if(GBrowserIsCompatible()) {
var map_compatible = true;
//alert(map_compatible);
}
if( map_compatible ) {
var map = new GMap2(document.getElementById('map'));        
var geocoder = new GClientGeocoder();
show_address(default_address);
map.setCenter(new GLatLng(34.830401262867504, -78.02392601966858), 6);
map.addControl(new GSmallMapControl());
map.addControl(new GMapTypeControl());
}
}
var map;
var directionsPanel;
var directions;
var startdirections;
function initialize() {
map = new GMap2(document.getElementById("map"));
directionsPanel = document.getElementById("directions_div");
startdirections = document.getElementById("startinput").value;
map.setCenter(new GLatLng(34.830401262867504, -78.02392601966858), 6);
directions = new GDirections(map, directionsPanel);
directions.load("" + startdirections + " to 34.830401262867504, -78.02392601966858");
}
/* This function will move the map and shows the address passed to it */
function show_address(address) {
if( map_compatible && geocoder ) {
/* Save this address in current_address value to use later if user wants directions */
current_address = address;		
geocoder.getLatLng(address,
function( point ) {
if( !point ) {
alert(error_no_map_info);
} else {
map.setCenter(point, 13);
var marker = new GMarker(point);
map.addOverlay(marker);
marker.openInfoWindowHtml(address);
}
}
);
}
return false;
}
/* Get the directions */
function get_directions() {
if(GBrowserIsCompatible()) {
var map_compatible = true;
//alert(map_compatible);
}
if(map_compatible) {
alert(map_compatible);
if( document.direction_form.from_address.value == '' ) {
alert(error_address_empty);
return false;
}
/**
* Delete the contents of 'directions' DIV first 
* because user might ask for directions more than once.
**/
document.getElementById('directions').innerHTML = '';
gdir = new GDirections(map, document.getElementById('directions'));
/* Setup to event handlers, one: when the directions are loaded, two: if there was any error */
GEvent.addListener(gdir, 'load',  onGDirectionsLoad);
GEvent.addListener(gdir, 'error', handleErrors);
/* Show the directions */
set_directions(document.direction_form.from_address.value, current_address);			
}
return false;
}
/* This will actually set the directions on the map and loads the direction table */
function set_directions(fromAddress, toAddress) {
gdir.load("from: " + fromAddress + " to: " + toAddress,
{ "locale": "en" });
}
/* This will handle the errors might happen while retrieving the directions */
function handleErrors(){
if( gdir.getStatus().code == G_GEO_UNKNOWN_ADDRESS )
alert(error_invalid_address);
else if( gdir.getStatus().code == G_GEO_SERVER_ERROR )
alert(error_google_error);
else if( gdir.getStatus().code == G_GEO_MISSING_QUERY )
alert(error_address_empty);
else 
alert(error_invalid_address);
}
/* This function will be called when the directions are loaded */
function onGDirectionsLoad(){
/* We will simply scroll down to the directions, but with a little delay so it's loaded */
// setTimeout('eval(\'window.location = "#directions_table"\;\')', 500); /* Uncomment this line if you need to */
}
function initialize_storemap(){
	var map = new GMap2(document.getElementById('StoresMap'));        
	var geocoder = new GClientGeocoder();
	show_address(default_address);
	map.setCenter(new GLatLng(34.830401262867504, -78.02392601966858), 6);
	map.addControl(new GSmallMapControl());
	map.addControl(new GMapTypeControl());
}
// Auto Tab Phone Number
function autotab(object, destination){
if (object.getAttribute && object.value.length == object.getAttribute("maxlength"))
destination.focus()
}




function displaybeachpromoalert(url) {
var r=confirm("Your information has been submitted.\nWould you like to visit Duplinwinery.com?");
if (r==true){
window.location = "http://www.duplinwinery.com"
}
else{
window.location = url;
}
}
function initNodes2(){
var uls = document.getElementById('xmasstore').getElementsByTagName("ul");
var i;
//alert(uls.length);
//for(i = 0; i < uls.length; i++)
//if(uls[i].id != "root")
//uls[i].style.display = "none";
//uls[i].style.display = "";
}
function clickNode(id){
//alert(id);
var node = document.getElementById(id);
if(node.style.display == "none"){
if(navigator.appName == "Netscape"){
//document.write('<div id="windowbuttons" style="position:relative;margin-top:-30px;margin-bottom:25px;"></div>');
//alert(node2.style.display);
node.style.display = "block";
}
if(navigator.appName == "Microsoft Internet Explorer"){
//document.write('<div id="windowbuttons" style="position:relative;"></div>');
//alert(arr2);
node.style.display = "block";
//node2.style.display = "true";
}
}else{
node.style.display = "none";
}
return false;
}
function openNode(){
//alert(document.location);
//alert('here');
var url_string = String(document.location);
var url_array1 = url_string.split('?');
var e_array = url_array1[1].split('&');
pullE(e_array[2]);
}
function pullE(val){
var useVal = val.split('=');
//alert(useVal[1]); //display purposes
//clickNode(useVal[1]);
var id = useVal[1];
var node2 = document.getElementById(useVal[1]);
//alert(val);
if(node2.style.display == "none"){
if(navigator.appName == "Netscape"){
//document.write('<div id="windowbuttons" style="position:relative;margin-top:-30px;margin-bottom:25px;"></div>');
//alert(id);
node2.style.display = "block";
}
if(navigator.appName == "Microsoft Internet Explorer"){
node2.style.display = "block";
//node2.style.display = "true";
}
}else{
node.style.display = "none";
alert(node.style.display);
}
}
function startPopUp(data){
z = setTimeout("eventPopUp("+data+");",50);
}
function eventPopUp(evnt){
var node = document.getElementById("eventpopupTable");
node.style.display = "none";
//clearTimeout(t);
//alert(evnt);
var xx =  window.event.clientX;
var yy =  window.event.clientY;
//var ary = new Array(evnt);
var node = document.getElementById("eventpopupTable");
var nodeh = node.style.height;
nodeh = nodeh.replace("px", "");
var winh = screen.height-300;
var newy = (yy/winh)*nodeh;
//alert(newy);
//writeevnt(evnt);
//evnt = evnt.replace("!||", "<br>");
//var tevnt = evnt.split("||", "<br>");
document.getElementById("eventTitles").innerHTML = evnt;
if(node.style.display == "none"){
//alert(node.style.display);
node.style.position = "fixed";
node.style.left = xx+20;
node.style.top = yy-newy;
node.style.display = "block";
node.style.display = "true";
}else{
node.style.display = "none";
//alert(node.style.display);
}
clearTimeout(z);
}
function eventPopDown(){
clearTimeout(t);
var node = document.getElementById("eventpopupTable");
node.style.display = "none";
}
function startclear(){
t = setTimeout("closeevents();",400);
}
function cleartime(){
clearTimeout(t);
}
function closeevents(){
var node = document.getElementById("eventpopupTable");
node.style.display = "none";
clearTimeout(t);
}
function alrt(varb){
alert(varb);
}
var z = 0;
function checkwindowfolder2(arr,page) {
//alert('here');
var javaarray = new Array();
javaarray = arr.split(",")
var arr2 = new Array();
arr2 = javaarray.sort()
checkbrowser2(arr,page);
}
function checkwindowfolder3(arr,page) {
//alert('here');
var javaarray = new Array();
javaarray = arr.split(",")
var arr2 = new Array();
arr2 = javaarray.sort()
checkbrowser3(arr,page);
}
function checkbrowser2(arr,page){
document.cookie="timer=0";
document.write('<div id="largewindow" style="filter:progid:DXImageTransform.Microsoft.Fade(duration=1); -moz-opacity:1;background-color:black;"></div>');
//document.write('<div id="largewindow"></div><br>');
//document.write('<div><div>here2</div>');
if(navigator.appName == "Netscape"){
document.write('<div id="windowbuttons" style="position:relative;margin-top:-30px;margin-bottom:25px;"></div>');
flipimageNS2(arr,page);
//alert('here');
}
if(navigator.appName == "Microsoft Internet Explorer"){
document.write('<div id="windowbuttons" style="position:relative;"></div>');
flipimageEI2(arr,page);
//alert(arr2);
}
if(navigator.appName == "WebTV"){
//alert("You're using the WebTV browser.")
}
}
function checkbrowser3(arr,page){
document.cookie="timer=0";
document.write('<div id="largewindow" style="filter:progid:DXImageTransform.Microsoft.Fade(duration=1); -moz-opacity:1;background-color:black;"></div>');
//document.write('<div id="largewindow"></div><br>');
//document.write('<div><div>here2</div>');
if(navigator.appName == "Netscape"){
document.write('<div id="windowbuttons" style="position:relative;margin-top:-30px;margin-bottom:25px;"></div>');
flipimageNS3(arr,page);
//alert('here');
}
if(navigator.appName == "Microsoft Internet Explorer"){
document.write('<div id="windowbuttons" style="position:relative;"></div>');
flipimageEI3(arr,page);
//alert(arr2);
}
if(navigator.appName == "WebTV"){
//alert("You're using the WebTV browser.")
}
}
function flipimageEI3(jarray,page){
//var ja = jarray.sort();
	var ja3= new Array();
	ja3 = jarray.split(",");
	ja3.sort()
	var numbr2 = ja3.length;
	//alert(ja3[5]);
	//document.getElementById("largewindow").innerHTML = numbr2;
	//var ja= jarray;
	//ja = jarray.split(",");
	if (document.getElementById("largewindow").filters) {//if browser supports IE filters and it is defined on the object
		document.getElementById("largewindow").filters[0] //access the first filter within object, in this case, the Fade filter
	}
	if(z <= (numbr2-1)){
		a=document.getElementById("largewindow");
		a.filters[0].apply();
		//alert(page+"/" +ja3[z]);
		a.innerHTML = "<?php include(\"uploads/images/?>"+page+"/" +ja3[z] + "<?php echo \");\"; ?>";
		//a.src = "uploads/images/"+page+"/"+ja3[z];
		//alert(z);
		a.filters[0].play();
		z = z+1;
		}else{
		//stoptimer();
		z = 0;
		a=document.getElementById("largewindow");
		a.filters[0].apply();
		a.innerHTML = "<img name=\"content\" width=\"955\" height=\"421\" src=\"uploads/images/"+page+"/" +ja3[z] + "\">";
		a.filters[0].play();
		//alert(z);
		//flipimageEI2("\""+ja3+"\",'"+page+"'");
		z = 1;
	}
	createwindowbuttons(numbr2,ja3,page,z);
	document.cookie="imagelist="+ja3;
	document.cookie="page="+page;
	//winint4 = setTimeout("flipimageEI2('"+ja3+"','"+page+"');", 9000);
}
function flipimageEI2(jarray,page){
//var ja = jarray.sort();
	var ja3= new Array();
	ja3 = jarray.split(",");
	ja3.sort()
	var numbr2 = ja3.length;
	//alert(ja3[5]);
	//document.getElementById("largewindow").innerHTML = numbr2;
	//var ja= jarray;
	//ja = jarray.split(",");
	if (document.getElementById("largewindow").filters) {//if browser supports IE filters and it is defined on the object
		document.getElementById("largewindow").filters[0] //access the first filter within object, in this case, the Fade filter
	}
	if(z <= (numbr2-1)){
		a=document.getElementById("largewindow");
		a.filters[0].apply();
		a.innerHTML = "<iframe name=\"content\" type=\"text/html\" width=\"955\" height=\"421\" src=\"uploads/images/"+page+"/" +ja3[z] + "\" frameborder=\"0\" SCROLLING=\"no\"></iframe><br>";
		//a.src = "uploads/images/"+page+"/"+ja3[z];
		//alert(z);
		a.filters[0].play();
		z = z+1;
		}else{
		//stoptimer();
		z = 0;
		a=document.getElementById("largewindow");
		a.filters[0].apply();
		a.innerHTML = "<iframe name=\"content\" width=\"955\" height=\"421\" src=\"uploads/images/"+page+"/" +ja3[z] + "\" frameborder=\"0\" SCROLLING=\"no\"></iframe>";
		a.filters[0].play();
		//alert(z);
		//flipimageEI2("\""+ja3+"\",'"+page+"'");
		z = 1;
	}
	createwindowbuttons(numbr2,ja3,page,z);
	document.cookie="imagelist="+ja3;
	document.cookie="page="+page;
	//winint4 = setTimeout("flipimageEI2('"+ja3+"','"+page+"');", 9000);
}
function getCookie(c_name)
{
if (document.cookie.length>0)
{
c_start=document.cookie.indexOf(c_name + "=");
if (c_start!=-1)
{ 
c_start=c_start + c_name.length+1; 
c_end=document.cookie.indexOf(";",c_start);
if (c_end==-1) c_end=document.cookie.length;
return unescape(document.cookie.substring(c_start,c_end));
} 
}
return "";
}
function startflip2(){
var ja3 = document.cookie.match ('(^|;)?imagelist=([^;]*)(;|$)');
var page = document.cookie.match ('(^|;)?page=([^;]*)(;|$)');
//var timer = document.cookie.match ('(^|;)?timer=([^;]*)(;|$)');
var timer = getCookie('timer');
//alert(timer);
page = unescape(page[2]);
ja3 = unescape(ja3[2]);
//alert(timer);
//alert(getCookie('timer'));
//alert(getCookie('page'));
if(navigator.appName == "Netscape"){
//timer = unescape(timer[2]);
//alert(getCookie('page'));
if(timer == null || timer == 0){
//alert('here');
winint4 = setTimeout("flipimageNS2('"+ja3+"','"+page+"');", 9000);
}
}else if(navigator.appName == "Microsoft Internet Explorer"){
//
//timer = unescape(timer[2]);
if(timer == '0'){
winint4 = setTimeout("flipimageEI2('"+ja3+"','"+page+"');", 9000);
}
}
}
function gotopage(url) {
window.location = url;
}
var count2 = 0;
function flipimageNS2(jarray2,page){
var javaarray3 = new Array();
javaarray3 = jarray2.split(",");
var numbr3 = javaarray3.length;
javaarray3.sort();
//var count = 0;
var inc = true;
if(z <= numbr3-1){
a=document.getElementById("largewindow");
a.innerHTML = "<iframe name=\"content\" width=\"955\" height=\"421\" src=\"uploads/images/"+page+"/" +javaarray3[z] + "\" frameborder=\"0\" SCROLLING=\"no\"></iframe>";
//a.innerHTML = "<script src=\"uploads/images/"+page+"/" +javaarray3[z] + "\">
z = z+1;
//alert("here");
//alert(a.src);
//doFade();
}else{
//alert("here");
//stoptimer();
z = 0;
a=document.getElementById("largewindow");
a.innerHTML = "<iframe name=\"content\" width=\"955\" height=\"421\" src=\"uploads/images/"+page+"/" +javaarray3[z] + "\" frameborder=\"0\" SCROLLING=\"no\"></iframe>";
z = 1;
//clearTimeout(winint);
//alert(a.src);
}
createwindowbuttonsNS(numbr3,javaarray3,page,z);
//winint5=setTimeout("flipimageNS2('"+javaarray3+"','"+page+"');", 9000);
document.cookie="imagelist="+javaarray3;
document.cookie="page="+page;
}
function doFade2() {
count = (inc) ? count+0.1 : count-0.1;
//alert(a);
a.style.MozOpacity = count;
if(count >= 0.9){
inc = false;
//clearTimeout(winint2);
}
if(count <= 0.1){
inc = true;
//clearTimeout(winint2);
}
winint6=setTimeout("doFade2('"+a+"');", 2000);
}
function stoptimer(){
clearTimeout(t);
}
function createwindowbuttons2(numb,arrays,page,z){
//alert(arrays);
var j = "";
c=document.getElementById("windowbuttons");
//b.filters[0].apply()
for(h = 1;h<=numb;h++){
if(h == z){
j = j+"<a style=\"z-index:"+500+h+"; position:relative; top:-30px; bottom:-30px; padding: 3px 5px 3px 5px; margin-left:4px;border:1px solid #ffffff;\" onMouseUp=\"gotowindow("+(h-1)+",'"+arrays+"','"+page+"'), createwindowbuttons("+numb+",'"+arrays+"','"+page+"',"+h+")\">"+h+"</a>";
}else if(h != z){
j = j+"<a style=\"z-index:"+500+h+"; position:relative; top:-30px; bottom:-30px; padding: 3px 5px 3px 5px; margin-left:4px;\" onMouseUp=\"gotowindow("+(h-1)+",'"+arrays+"','"+page+"'), createwindowbuttons("+numb+",'"+arrays+"','"+page+"',"+h+")\">"+h+"</a>";
}
}
c.innerHTML = j;
}
function createwindowbuttonsNS2(numb,arrays,page,z){
//alert(arrays);
var j = "";
c=document.getElementById("windowbuttons");
//b.filters[0].apply()
for(h = 1;h<=numb;h++){
if(h == z){
j = j+"<a style=\"z-index:700; margin-left:4px;  padding:3px 5px 3px 5px;border:1px solid #ffffff;\" onMouseUp=\"gotowindow("+(h-1)+",'"+arrays+"','"+page+"'), createwindowbuttonsNS("+numb+",'"+arrays+"','"+page+"',"+h+")\">"+h+"</a>";
}else if(h != z){
j = j+"<a style=\"z-index:700; margin-left:4px; padding:3px 5px 3px 5px;\" onMouseUp=\"gotowindow("+(h-1)+",'"+arrays+"','"+page+"'), createwindowbuttonsNS("+numb+",'"+arrays+"','"+page+"',"+h+")\">"+h+"</a>";
}
}
c.innerHTML = j;
}
function gotowindow(d,b,page){
//alert(b.length);
//document.cookie="timer=stopped";
clearTimeout(winint4)
document.cookie="timer=1";
var arr = new Array();
arr = b.split(",");
a=document.getElementById("largewindow");
//a.filters[0].apply()
a.innerHTML = "<iframe width=\"955\" height=\"421\" src=\"uploads/images/"+page+"/" +arr[d] + "\" frameborder=\"0\" SCROLLING=\"no\"></iframe>";
//a.innerHTML = "<?php echo \"here\";?>";
//alert(arr[d]);
}
function checkUrl(){
var browUrl = document.location.href;
//document.write (browUrl); 
if(browUrl == 'http://duplinwinery.com/'){
window.location = "http://www.duplinwinery.com"
} 
}
function OpenDistributor(){
//alert('here');
document.open("http://www.duplinwinery.com/phpincludes/distributor.php","","width=600,height=800"); 

}
function DisplayCruiseDiv(DivID){
	//alert(DivID);
	for(z=0;z<7;z++){
		//alert(z);
		document.getElementById(z).style.display = "none";
	}
	//alert(DivID);
	document.getElementById(DivID).style.display = "block";
}
function setCookie(c_name,value)
{

document.cookie=c_name+ "=" +escape(value);
}
function getCookie(c_name)
{
if (document.cookie.length>0)
  {
  c_start=document.cookie.indexOf(c_name + "=");
  if (c_start!=-1)
    {
    c_start=c_start + c_name.length+1;
    c_end=document.cookie.indexOf(";",c_start);
    if (c_end==-1) c_end=document.cookie.length;
    return unescape(document.cookie.substring(c_start,c_end));
    }
  }
return "";
}
function checkCookie()
{
//alert(getCookie('username'));
username=getCookie('username');

if (username!=null && username!="")
  {
  //alert("Cookies Work");
  }
else
  {
  //username=prompt('Please enter your name:',"");
  //alert("cookie");
  
	alert("If your login failed, and you are sure you entered the correct password. Please check to make sure you have cookies enabled on your web browser.");
    
	//alert(getCookie('username'));
    
  }
}
//document.onload = setCookie('username','CookiesWork');
//document.onload = checkCookie();
