$(document).ready(function() {
	if($.browser.msie) {
		$('.header .sel-lang, .nav > li').mouseover(function() {
			$(this).addClass('hover');
		});
		$('.header .sel-lang, .nav > li').mouseout(function() {
			$(this).removeClass('hover');
		});
	}
	$('.nav > li > a').mouseover(function() {
		$(this).parent().addClass('first-hover');
	});
	$('.nav > li > a').mouseout(function() {
		$(this).parent().removeClass('first-hover');
	});
	
//	$("input[type='text'], input[type='password']").addClass('line');
//	$(".line").focus(function() {
//		if($(this).css("background-image").search(/password/) != -1 || $(this).css("background-image").search(/signin/) != -1) {
//			$(this).css("background-image", "url(images/login_input-bg.gif)")
//		}
//	});
});
function getID ( id ) {
  if (( typeof document.getElementById(id)) == 'object' )
    return document.getElementById(id);
  else
    return eval ( 'document.' + id );
}
function changeField ( obj, typ ) {
	switch ( obj.name ) {
		case 'username':
			alert ( obj.name + typ );
			if ( typ )
				obj.value = ( obj.value == obj.title ) ? '' : obj.value;
			else	
				obj.value = ( obj.value == '' ) ? obj.title : obj.value;
			break;
		case 'password':
			if ( typ && obj.type != 'pasword' ) {
				getID('passwordSpan').innerHTML = '<input class="line password" name="password" id="password" type="password" value="" title="' + obj.title + '" onfocus="changeField(this, true);" onblur="changeField(this, false);" />'; 
				alert ( getID('passwordSpan').innerHTML );
			}			
			if ( ! typ && obj.value == '' ) {
				getID('passwordSpan').innerHTML = '<input class="line password" name="password" id="password" type="text" value="' + obj.title + '" title="' + obj.title + '" onfocus="changeField(this, true);" onblur="changeField(this, false);" />'; 
			}
			break;
	}	
}
