// JavaScript Document

// Calling JQuery
var jsServer = "/js/";
var imageServer = '/images/';

var isDev = true;

$(document).ready(function() { 
    if (isDev) {
        jsServer = '/Visapp' + jsServer;
        imageServer = '/Visapp' + imageServer;
    }
});

function hideAnswer(id)
{
	$(id).slideToggle("slow");

	$(this).toggleClass("active"); 	return false;
}

function modifyCSS( ) 
{   
	$("#index_banner").html( ".head_image1");  
}

function changeClass(img) {
		document.getElementById("index_banner").className= img;
//		alert("Hello");
//		"index_banner".className= "head_image1";
	}
function defaultClass() {
		document.getElementById("index_banner").className= "head_image";
//		alert("Hello");
//		"index_banner".className= "head_image1";
	}

function hideDiv(disDiv,hideDiv)
{
	var Obj, Obj1;
	Obj = document.getElementById(hideDiv).style;
	Obj1 = document.getElementById(disDiv).style;
	Obj.visibility="hidden";
	Obj1.visibility="visible" ;
	Obj.display="none";
	Obj1.display="block";
	
//	Obj1.margin-top="100px";
//	$('#index_banner').css("background-image", 'url(public/images/_accessories.png)'); 
//	alert("hi");
//	$(id).slideToggle("slow");
//	$(this).toggleClass("active"); 	return false;
}

$(function() {
			
			$(".slidetabs").tabs(".images > div", {
			
				// enable "cross-fading" effect
				effect: 'fade',
				fadeOutSpeed: "slow",
				
				// start from the beginning after the last tab
				rotate: true
			
			// use the slideshow plugin. It accepts its own configuration
			}).slideshow();
			});

function showOneDiv(disDiv,hideDiv)
{	
	var Obj, Obj1;
	
	Obj1 = document.getElementById(disDiv).style;
	var i=0;
	for (i=0;i<=5;i++)	{				
		Obj = document.getElementById(hideDiv+i).style;
		if(Obj==Obj1) {			
			Obj1.visibility="visible" ;	
			Obj1.display="block";
		}
		else {
			Obj.visibility="hidden";
			Obj.display="none";
		}
	}
}

function showFacebox(msg) {
    jQuery.facebox(msg);
}

function showFPDialogue() {
    $.ajax({
	    type: "GET",
	    url: "forgotpasword.aspx",
	    success: function(data){
		    showFacebox(data);
	    },
	    failure: function(){
	        alert("Coming soon ..");
	    }
    });
}


function showAddProductDialogue(status) {
    
    //alert('Okay');
    if(status == "Validate"){
          document.location.href='AddProduct.aspx?type=signed';
      }
    else
    {
    
    $.ajax({
	    type: "GET",
	    url: "AddProduct.aspx?type=unsigned",
	    success: function(data){
		    showFacebox(data);	    
	    },
	    failure: function(){
	        alert("Coming soon ..");
	    }
    });
   }

return true;
}

function showAddListingDialogue(status) {
    
    //alert('Coming Soon! In Progress');
    if(status == "Validate"){
          document.location.href='AddListing.aspx?type=signed';
      }
    else
    {
    
    $.ajax({
	    type: "GET",
	    url: "AddListing.aspx?type=unsigned",
	    success: function(data){
		    showFacebox(data);	    
	    },
	    failure: function(){
	        alert("Coming soon ..");
	    }
    });
   }

return true;
}

function showBannerDialogue(status) {
    //alert('Coming Soon! In Progress');
    if(status == "Validate"){
          document.location.href='bannerads.aspx?type=signed';
          return true;
      }
    else
    {
    

    $.ajax({
	    type: "GET",
	    url: "bannerads.aspx?type=unsigned",
	    success: function(data){
		    showFacebox(data);	    
		    return false;
	    },
	    failure: function(){
	        alert("Coming soon ..");
	    }
    });
   }

return false;
}
