
//javascript on
$('head').append('<link rel="stylesheet" type="text/css" href="/styles/javascript.css" media="all">');


$(function(){

//place holder
	$("form input.placeHolder[type$='text']").each(function(i){
		$(this).val($(this).attr('title')).focus(function(){
				if($(this).val()==$(this).attr('title'))$(this).val('');		
		}).blur(function(){
				if($(this).val()=='')$(this).val($(this).attr('title'));
		});
	});
	$('form').submit(function(){
		$("form input.placeHolder[type$='text']").each(function(i){
			if($(this).val()==$(this).attr('title'))$(this).val('');	
		});
	});
	
//rollover images
	$("form input.rollover[type$='image']").each(function(){
		var img= new Image();
		var uri=$(this).attr('src');
		img.src=uri.replace('.','Over.');
	}).hover(function(){
		var uri=$(this).attr('src');
		uri=uri.replace('Over','');
		uri=uri.replace('.','Over.');
		$(this).attr('src',uri);
	},function(){
		var uri=$(this).attr('src');
		uri=uri.replace('Over','');
		$(this).attr('src',uri);	
	});
// submit form when user changed value
	$('.onChange').change(function(){
		this.form.submit();
	});
//hover
	$(".over").hover(function(){
		$(this).parent(".over").addClass("hover");
		$(this).addClass("hover");
	},function(){
		$(this).removeClass("hover");
		$(this).parent(".over").removeClass("hover");
	});	
	
	
	
	
});
























/* by Scott Andrew (http://www.scottandrew.com/) */
function createCookie(name, value, days) {
  if (days) {
    var date = new Date();
    date.setTime(date.getTime()+(days*24*60*60*1000));
    var expires = "; expires="+date.toGMTString();
  }
  else expires = "";
  document.cookie = name + "=" + value + expires + "; path=/";
}

function readCookie(name) {
  var nameEQ = name + "=";
  var ca = document.cookie.split(';');
  for(var i=0;i < ca.length;i++) {
    var c = ca[i];
    while (c.charAt(0)==' ') c = c.substring(1, c.length);
    if (c.indexOf(nameEQ) == 0) 
    	return c.substring(nameEQ.length, c.length);
  }
  return null;
}

function eraseCookie(name) {
	createCookie(name,"",-1);
}