/*
  @project  CreativeConstructor 2.0 jQuery prograssive enhancement
  @name jquery.page.js
  @author lukasz.tyrala
  @version  0.1
  @description  Requires jQuery (1.3+ branch recomended)
*/

jq(document).ready(function(){

  jq(".flash").click(function(){
    jq(this).slideUp();
  });

  jq("input.tgg").inputHover();

  jq(".toolbar").wrapContent('inner');

  jq(".header").multiNav();


  /**
   * Global handler for ajax unauthorized responses
   */
  jq(this).ajaxComplete(function(event, request, options){
    if(request.status == 403) window.location = window.location
  });

	// Default login and apssword
	  var 	LOGIN = 'wmid',
	  		PASS = 'password';

	  	// Login
	  	jq('.login-teaser-form #user_email').attr('value', LOGIN);
	  	jq('.login-teaser-form #user_email').focus(function() {
	  		if (jq(this).attr('value') == LOGIN)
				jq(this).attr('value', '');
	  	});
	  	jq('.login-teaser-form #user_email').blur(function() {
		 	if (jq(this).attr('value') == '')
				jq(this).attr('value', LOGIN);
		});

	  	// Password
	  	jq('.login-teaser-form #user_password').attr('value', PASS);
	  	jq('.login-teaser-form #user_password').focus(function() {
	  		if (jq(this).attr('value') == PASS)
				jq(this).attr('value', '');
	  	});
	  	jq('.login-teaser-form #user_password').blur(function() {
		 	if (jq(this).attr('value') == '')
				jq(this).attr('value', PASS);
		});



}); // /document.ready

