

var $j = jQuery.noConflict();

$j(document).ready(function(){
  // BodyFade();
 
  ImageCycle();
  
  if( detectBrowser())
  {// browser Check Start
  // if not IE 6 then do this Code.
		ImageFadeinOut()// 
  } // browser Check Start 
});


/*-----------------------------------------------------------------------------------------------------------------------------
* Function: detectBrowser
* Description: This function Check browser and verson for IE 6  and Return True or false
* Return Type: True(1)/ False(null) 
* Author: Tanvir Ahmad Ronty
    ---------------------------------------------------------------------------------------------------------------------------*/

function detectBrowser()
{
var browser=navigator.appName;
var b_version=navigator.appVersion;
var version=parseFloat(b_version);
if ((browser=="Microsoft Internet Explorer") && (version<=6))
	{
	return false;
	}
else
	{
	return true;
	}
}


/*-----------------------------------------------------------------------------------------------------------------------------
* Function: ImageCycle
* Description: This funciton displays case stufy images one after another.
* Notes: Add 'imagehide' class to all of your image except first image.
* Author: Tanvir Ahmad Ronty
    ---------------------------------------------------------------------------------------------------------------------------*/

function ImageCycle()
{
	$j('#preview img').removeClass("imghide");
	
	$j('#preview').cycle({ 
    fx:    'fade', 
     speed:  500,
	 timeout:  7000 
	 });
}





/*-----------------------------------------------------------------------------------------------------------------------------
* Function: ImageFadeInOut
* Description: This funciton fades in CouchCreative logo and our work thumbnails.
* Notes: Does not work in IE6
* Author: Dhruv Raniga
    ---------------------------------------------------------------------------------------------------------------------------*/

function ImageFadeinOut()
{
	 // img item au demarrage
	$j("img.item").each(function () {
      $j(this).stop().fadeTo(1, 0.4);
    });
	
	// img item au survol
   	$j("img.item").mouseover(function () {
      $j(this).stop().fadeTo("slow", 1);
    });
	
// img item au retour
	$j("img.item").mouseout(function () {
      $j(this).stop().fadeTo("slow", 0.4);
    });
	
	// fading
	$j("img.fading").mouseover(function () {
    	$j(this).stop().fadeTo("slow", 0.4);
    });

	$j("img.fading").mouseout(function () {
     	$j(this).stop().fadeTo("slow", 1);
    });
}


