$(document).ready(function(){

	turn_font();	

	newsletter();

	newsletter2();

	load_about();

});



/**

 * Change font

 */

function turn_font()

{

	a = $('h1');

	for(i=0; i<a.length; i++)

	{

		$(a[i]).replaceWith(turn_h1($(a[i]).html(), '100%', '42', '24', '0x0960a7'));	

	}

	

	a = $('h3');

	for(i=0; i<a.length; i++)

	{

		$(a[i]).replaceWith(turn_h1($(a[i]).html(), '100%', '30', '18', '0x506dad'));	

	}

	

	$('#banner div').replaceWith(turn_h1($('#banner div').html(), '100%', '50', '42', '0xe2f3fc'));

}

/**

 * Out put a swf for the spec font

 */

function turn_h1(val, w, h, font_size, color)

{
	var SITE_URL = '';		
	if( $('#SITE_URL').html() != null) SITE_URL = $('#SITE_URL').html();	
	
	str = '<object width="'+ w +'" height="'+ h +'">';

	str += '<param name="movie" value="'+ SITE_URL +'font.swf" />';

	str += '<param name="quality" value="high" />';

	str += '<param name="wmode" value="transparent" />';

	str += '<param name="FlashVars" value="color='+color+'&size='+ font_size +'&t='+ val +'" />';

	str += '<embed src="'+ SITE_URL +'font.swf" wmode="transparent" FlashVars="color='+color+'&size='+font_size+'&t='+ val +'" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="'+ w +'" height="'+ h +'"></embed></object>';	

	return str;	

}



/**

 * Newsletter Input Value Change

 */

function newsletter()

{

	$('#name').focus(function(){

		if($(this).val()=='Your Name')

			$(this).val('');

	});	

	$('#name').blur(function(){

		if($(this).val()=='')

			$(this).val('Your Name');

	});	

	$('#email').focus(function(){

		if($(this).val()=='Your Email')

			$(this).val('');

	});	

	$('#email').blur(function(){

		if($(this).val()=='')

			$(this).val('Your Email');

	});	

}

function newsletter2()

{

	$('#name2').focus(function(){

		if($(this).val()=='Your Name')

			$(this).val('');

	});	

	$('#name2').blur(function(){

		if($(this).val()=='')

			$(this).val('Your Name');

	});	

	$('#email2').focus(function(){

		if($(this).val()=='Your Email')

			$(this).val('');

	});	

	$('#email2').blur(function(){

		if($(this).val()=='')

			$(this).val('Your Email');

	});	

}





function load_about()

{

	$('#your_name').focus(function(){

		if($('#your_name').val()=='Your Name') $('#your_name').val('');

	});	

	$('#your_name').blur(function(){

		if($('#your_name').val()=='') $('#your_name').val('Your Name');

	});	

	

	$('#your_email').focus(function(){

		if($('#your_email').val()=='Your Email') $('#your_email').val('');

	});	

	$('#your_email').blur(function(){

		if($('#your_email').val()=='') $('#your_email').val('Your Email');

	});

	

	$('#subject').focus(function(){

		if($('#subject').val()=='Subject') $('#subject').val('');

	});	

	$('#subject').blur(function(){

		if($('#subject').val()=='') $('#subject').val('Subject');

	});

	

	$('#comment').focus(function(){

		if($('#comment').val()=='Comment') $('#comment').val('');

	});	

	$('#comment').blur(function(){

		if($('#comment').val()=='') $('#comment').val('Comment');

	});

}











function check1()

{

	

	if($('#your_email').val()=='' || $('#your_email').val()=='Your Email')

	{

		alert('Please input your email');

		$('#your_email').focus();

		return false;

	}

	

	if(Check_Email($('#your_email').val()))

	{

		alert('Please input your email');

		$('#your_email').focus();

		return false;

	}

	

	

	$('#form2').submit();

}



/**

 * Check Newsletter Form

 */

function check()

{

	name = $('#name').val();

	if(name=='' || name=='Your Name')

	{

		alert('Please input your name!');

		return false;

	}

	

	email = $('#email').val();

	if(email=='' || email=='Your Email' || Check_Email(email))

	{

		alert('Please input your email');

		return false;

	}

	return true;

	

}



function check2()

{

	

	name = $('#name2').val();

	

	if(name=='' || name=='Your Name')

	{

		alert('Please input your name!');

		return false;

	}

	

	email = $('#email2').val();

	if(email=='' || email=='Your Email' || Check_Email(email))

	{

		alert('Please input your email');

		return false;

	}

	return true;

	

}





function   Check_Email(string){     

	var   str_len   =   string.length;   

	if   (str_len<=5){   

		return   true   

		  }       

	for(i=0;i<str_len;i++){   

		  if   (string.charCodeAt(i)>127){   

	return   true     

	}   

	}   

	if   (string.indexOf("@")<2){   

		  return   true   

		  }       

				  if   (string.indexOf(".")==1){   

		  return   true   

		  }       

	if   (string.indexOf(":")!=-1){   

		  return   true   

	}   

} 





function do_email()

{

	str = '<a href="mailto:info@globalbenefitoptions.com">info@globalbenefitoptions.com</a>';

	document.write(str);

}


