text1 = "View portfolio page";
text2 = "Find out how to contact Virtual Designs";
text3 = "Information about Virtual Designs, pricing etc.";
text4 = "Services available from Virtual Designs";

port_text1 = "The Jerram Gallery - Contemporary and older paintings";
port_text2 = "Famous Fishing - Classic Chalke stream flyfishing and tuition";
port_text3 = "Workshops Direct - A directory of all designers and makers";
port_text4 = "Maywood of Fordingbridge - Kitchens and furniture both fitted and free standing";

serv_text1 = "View our glossery of terms page.";
serv_text2 = "Check the availability of domain names.";

terms_text = "Please read the terms and conditions";
close_text = "Close the window";

jerr_text = "The Jerram Gallery";

 if ( window.screen ){
 		 availableWidth = screen.width;
 		}
	else{
 		 availableWidth = 800;
 		}
	screen_size();
	
//###################################################
	if (document.images)
	{
		ani_smartie =new Image;
		smartie = new Image;
		
		smartie.src = 'images/smartie.gif';
		ani_smartie.src = 'images/ani-smartie.gif';
	}
	else
	{
		document.ani_smartie1 = "";
		document.ani_smartie2 = "";
		document.ani_smartie3 = "";
		document.ani_smartie4 = "";
		document.inf_text = "";
		ani_smartie = "";
		smartie = "";
	}
	
function load_images()
{
	port_t = new Image;
	cont_t = new Image;
	spec_t = new Image;
	serv_t = new Image;
	blank_t = new Image;
	
	port_t.src = 'images/port_text.gif';
	cont_t.src = "images/cont_text.gif";
	spec_t.src = "images/spec_text.gif";
	serv_t.src = "images/serv_text.gif";
	blank_t.src = "images/inf_blank.gif";
}
function set_null()
{
	port_t = "";
	cont_t = "";
	spec_t = "";
	serv_t = "";
	blank_t = "";
}
//##################################################
function check_form()
{
 if ( document.whois.domain.value.length <= 1 ){
    alert( 'Please enter a domain name !   ' );
	 return false;
  }
}
//##################################################
function open_win()
{
mw=window.open('dom-terms.html','dot_terms','width=450,height=300,scrollbars=yes,resizable=no,top=40,left=20,screenX=20,screenY=40');
}

//##################################################

function Swap(image_name, image_num, image_text, image_src)
{
 if (image_num == '0' ){
  window.status = image_text;
 }
 else{
  var target = image_name+image_num;
  document[target].src = image_src.src;
  window.status = image_text;
 }
}

function Swap_back(image_name, image_num, image_text, image_src)
{
var target = image_name+image_num;
 document[target].src = image_src.src;
 window.status = image_text;
}

function swap2(image_name, image_src)
{
	document[image_name].src = image_src.src;
}

function swap2_bac(who)
{
if ( who == 'port' ){
 	document.port_img.src = "images/port_default.jpg";
 }
if ( who == 'pic' ){
 	document.pic_text.src = blank_text.src;
 }
if ( who == 'title' ){
 	document.title_pic.src = title_blank.src;
 }
if ( who == 'index_texts' ){
 	document.inf_text.src = "images/inf_blank.gif";
 }
}
// ########################################################## 
// #                                    cookie Section                                        #
// ##########################################################
function setCookie(name, value, expires, path, domain, secure) 
{
  var curCookie = name + "=" + escape(value) +
      ((expires) ? "; expires=" + expires.toGMTString() : "") +
      ((path) ? "; path=" + path : "") +
      ((domain) ? "; domain=" + domain : "") +
      ((secure) ? "; secure" : "");
  document.cookie = curCookie;
}

function getCookie(name) 
{
  var dc = document.cookie;
  var prefix = name + "=";
  var begin = dc.indexOf("; " + prefix);
  if (begin == -1) {
    begin = dc.indexOf(prefix);
    if (begin != 0) return null;
  } else
    begin += 2;
  var end = document.cookie.indexOf(";", begin);
  if (end == -1)
    end = dc.length;
  return unescape(dc.substring(begin + prefix.length, end));
}

function deleteCookie(name, path, domain) 
{
  if (getCookie(name)) {
    document.cookie = name + "=" + 
    ((path) ? "; path=" + path : "") +
    ((domain) ? "; domain=" + domain : "") +
    "; expires=Thu, 01-Jan-70 00:00:01 GMT";
  }
}
//######################################################
function screen_size()
 {
 	
	
  	screen_size = getCookie("resolution");
	
	if ( !screen_size )
	 {
		//expireDate = new Date();
		//expireDate.setMonth(expireDate.getMonth()+3);
		//expireDate.toGMTString();
		expireDate = "";
		setCookie("resolution", availableWidth, expireDate );
	 }
	 
	browser_type = getCookie("browser");
	if ( !browser_type )
 	{
		//expireDate = new Date();
		//expireDate.setMonth(expireDate.getMonth()+3);
		//expireDate.toGMTString();
		expireDate = "";
		
		is_nav = get_browser();
		setCookie("browser", is_nav, expireDate);
		browser_type = "false";
 	}
 }

//####################################################
 function get_browser()
 {
 	// convert all characters to lowercase to simplify testing
var agt=navigator.userAgent.toLowerCase();
// *** BROWSER VERSION ***
// Note: On IE5, these return 4, so use is_ie5up to detect IE5.
var is_major = parseInt(navigator.appVersion);
var is_minor = parseFloat(navigator.appVersion);
// Note: Opera and WebTV spoof Navigator. We do strict client detection.
// If you want to allow spoofing, take out the tests for opera and webtv.
var is_nav = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1)
&& (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1)
&& (agt.indexOf('webtv')==-1));
return is_nav;
}

