/**
 * @author Sunil Williams
 * This file define beviours across zici.net
 */

$(document).ready(function(event){


	//this function employs a jquery plugin
	//and works around ie6's crappy
	//png transparency support
	jQuery(function($) {
		$("img[@src$=png], #header_image, #logo").pngfix();
	    });


	//make the logo selectable
	$("#logo").click(function(){
		window.location=$(this).find("a").attr("href");
		return false ;
	    }) ;
	// and add a cursor pointer to on hover
	$("#logo").hover(function(){
		$(this).addClass('hover_pointer') ;},
			function() {
				$(this).removeClass('hover_pointer') ;
	} ) ;




	//make the video-demo images look like links
		    // and add a cursor pointer to on hover
		    $(".demo_image").hover(function(){

				       $(this).addClass('hover_pointer') ;},
				     function() {

				       $(this).removeClass('hover_pointer') ;
				     } ) ;


	// If we are in demo-login.php page, hide the register div.
	// Later, we will reveal it if the user so desires.
	$("#register_div").hide() ;




	//We now make our decorative boxes selectable
	$("#overcharging").hover(function(){
		$(this).addClass('hover_pointer') ;},
			function() {
				$(this).removeClass('hover_pointer') ;
	} ) ;
	//
	$("#overcharging").click(function(){
		window.location=$(this).find("a").attr("href");
		return false ;
	    }) ;


	$("#billing").hover(function(){
			$(this).addClass('hover_pointer') ;},
			function() {
				$(this).removeClass('hover_pointer') ;
	} ) ;
	$("#billing").click(function(){
		window.location=$(this).find("a").attr("href");
		return false ;
	    }) ;

	$("#abuse").hover(function(){
		$(this).addClass('hover_pointer') ;},
		function() {
			$(this).removeClass('hover_pointer') ;
	} ) ;
	$("#abuse").click(function(){
		window.location=$(this).find("a").attr("href");
		return false ;
	    }) ;


	//make  #link_to_demo actually link to demo
	//
	$("#link_to_demo").click(function(){
		window.location=$(this).find("a").attr("href");
		return false ;
	    }) ;
	// and add a cursor pointer to on hover
	$("#link_to_demo").hover(function(){
		$(this).addClass('hover_pointer') ;},
			function() {
				$(this).removeClass('hover_pointer') ;
	} ) ;


	$('#service_features li').hover(function()
	{
		$(this).addClass('list-hover') ;
	}, function() {$(this).removeClass('list-hover') ;
	}) ;

	$(' #sddm li a').hover(function()
	{
		$(this).addClass('nav_item_hover') ;
	}, function() {$(this).removeClass('nav_item_hover') ;
	}) ;

	$('#m2').hover(function()
	{
		$(this).addClass('nav_div_hover') ;
	}, function() {$(this).removeClass('nav_div_hover') ;
	});


    //pop-up windows for our pdf's
    $("a[rel='pop-up']").click(function () {
            var features = "height=700,width=800,scrollTo";
            newwindow=window.open(this.href, 'Popup', features);
            return false;
        });

	      //pop-up windows for our contact form
    $("a[rel='contact-popup']").click(function () {
            var features = "height=600,width=500,scrollTo";
            newwindow=window.open(this.href, 'Popup', features);
            return false;
        });



	//$("thing1").hide("slow", function() { $("thing2").show("slow") });

	$("#access_registration_form").click(function(event){
		$("#demo_signin").hide("slow",
					   function() {
					       $("#register_div").show("slow");
					   });
	    });

	$("#google_search_input").click(function()
					{

					    $(this).val("") ;
					    $(this).addClass("searchtext") ;
					}) ;

    }) ;














