jQuery(function(){	

	var urlForQuickLink = document.location.href;
	var paramIndexQuickLink = urlForQuickLink.indexOf("=")+1;
	if (paramIndexQuickLink >= 0) {
		var paramStringQuickLink = urlForQuickLink.substring(paramIndexQuickLink, urlForQuickLink.length);
		$('#menu2 li ul li a').each(function(){
		
			var quickLinkUrl = $(this).attr('href');
			if(quickLinkUrl.indexOf(paramStringQuickLink)>0){
				$(this).addClass('selectOn');
			}
		});
		
		
		
		
	}
	


	$.getJSON("inside-banner.txt",
        function(data){
        
		  	var urlForBg = document.location.href;
		  	var paramIndex = urlForBg.indexOf("=")+1;
			if(paramIndex>=0){
				var paramString = urlForBg.substring(paramIndex,urlString.length);
				 $("#banner").css("background-image","url(../img/common/bg/insideBanner1.png)");			
				$.each(data.items, function(i,item){
				if(typeof(item)!="undefined"){							
					if(paramString==item.page){
						//alert(paramString+":"+item.link);	
						$("#banner").css("background-image","url("+item.link+")");
						$(".crumb").html('').append(item.crumb); 
					}	
				}				
             	});
			}
        });

	 
	 $('.closeButton img').click(function(){
	 	$('.maskContent').css('display','none');
		  $('.maskContent').css('visiblity','hidden');
		  
	 	 $('.mask').animate({ 
  			 opacity: 0
	 	 }, 500 ,function(){$('.mask').css('display','none').css('opacity','0.5');});
		  
	 });
	 //for close in products
	 
	 $('.closeButton1 img').click(function(){
	 
	 	$('.maskContent').css('display','none');
		  $('.maskContent').css('visiblity','hidden');
		  
	 	 $('.mask').animate({ 
  			 opacity: 0
	 	 }, 500 ,function(){$('.mask').css('display','none').css('opacity','0.5');});
		  
	 });
	 $('.closeButtonThankYou img').click(function(){	 
	 var loc=String(window.location);	 
	window.location= loc.replace('content.htm?valid&type0Aboutpage=contact-us.htm','index.htm');	
	 });
	 //

	
	//initMenu('menu2','oneOpen',0);
		
	initMenu('menu1','everyOpen',0);
	
	$('.resourceItem a').hover(
		function(){
			$(this).parent('.resourceItem').addClass('hover');	
		},
		function(){
			$(this).parent('.resourceItem').removeClass('hover');	
		}
	);	
	
	var leftContent=function(urlString){
	
		var paramIndex = urlString.indexOf("=")+1;
		if(paramIndex==0){
			return false;
		}
		var paramString = urlString.substring(paramIndex,urlString.length);
	
		var title=new Array();

		//alert(paramString);
		$.ajax({
		  url: 'sub/'+paramString,
		  cache: false,
		  success: function(html){
	
		     if ($(html).children('.ATSh1,.ITLSh1').html() == null) {
			 	$('#menu1').hide();
			 	
				if(urlString.indexOf("contentps")>=0){
				
					$('#content').css('width','720px');
				}				
			 	$('#menuEnd1').hide();
			 	return false;
			 }
			 else {
			 	$('#menu1').show();
			 	$('#menuEnd1').show();
			 }
			$("#menu1").html('');
			$(html).children('.ATSh1,.ITLSh1').each(function(i){
				title[i]=$(this).html();
			});
			$(html).children('ul').each(function(i){
				var menuStatus;
				(i==0)?menuStatus='menuOpen':menuStatus='menuOpen';
				var tempString='<li><a href="#" class="'+menuStatus+'">'+title[i]+'</a><ul>'+$(this).html()+'</ul></li>';
				$("#menu1").append(tempString);
			});
			initMenu('menu1','everyOpen',0)
			
			$('#menu1 li ul li img').hover(
				 function(){
				 	//$(this).attr('width',180);
					//$(this).attr('height',155);
					$(this).css('position','relative');
					//$(this).css('left','-14px');
					$(this).animate( { width: '180'}, { queue: false, duration: 200 } );
					$(this).animate( { height: '155'}, { queue: false, duration: 200 } );
					
					$(this).animate( { left: '-14px'}, { queue: false, duration: 200 } );

					
				 },
				 function(){
				 	//$(this).attr('width',153);
					//$(this).attr('height',88);
					$(this).css('position','relative');
					//$(this).css('left','0px');
					$(this).animate( { width: '153'}, { queue: false, duration: 200 } );
					$(this).animate( { height: '88'}, { queue: false, duration: 200 } );
					
					$(this).animate( { left: '0px'}, { queue: false, duration: 200 } );
				 }
			 );
			
		  }
		});
		
		return false;
	}
	
	var redirectUrl=function(urlString){
	
		var paramIndex = urlString.indexOf("=")+1;
		if(paramIndex==0){
			return false;
		}
		var paramString = urlString.substring(paramIndex,urlString.length);
		//alert(paramString);
		$.ajax({
		  url: paramString,
		  cache: false,
		  success: function(html){
		    $("#contentDetail").html("");
			$("#contentDetail").append(html);
			 
			if(box.dom("#register").length>0){
				 
		    	box.ui('form').create({
		        	element: '#register'
		    	}).addReplacement();
			}
			if(box.dom("#eventTableNew").length>0){
				$('#eventTableNew tr:even').addClass('alt');
				$('#eventTable tr').click(function(){
					 
					 $('.mask').animate({ 
				 		 opacity: 'show'
					  }, 1500 );
					 
					
					 $.ajax({
						  url: "event1.htm",
						  cache: false,
						  success: function(html){
						  
						  	//alert($('.maskContent').html());
						    $('.maskContentDetail').html("");
							$('.maskContentDetail').append(html);
							$('.maskContent').css('display','block');
							$('.maskContent').css('visiblity','visible');
							
							//$('.maskContent').animate({opacity:'none'}, 1500); 
							
							//$('.maskContent').animate({opacity: 1}, 1500); 
							
			//$(e).find("img.shadow").stop().animate({ width: "85px", height: "20px", marginLeft: "10px", opacity: 0.25 }, 250);
	        //$(e).find("img.shadow").stop().animate({ width: "65px", height: "10px", marginLeft: "20px", bottom: "-10px", opacity: "none" }, 250);
		
						  }
						});	
				});
			}
			//start zakeer
			if(box.dom("#eventTable1").length>0){
				
				$('#eventTable1 a').click(function(){
					 
					 $('.mask').animate({ 
				 		 opacity: 'show'
					  }, 1500 );
					 
					
					 $.ajax({
						  url: "GuestLogin.htm",
						  cache: false,
						  success: function(html){
						  
						  	//alert($('.maskContent').html());
						    $('.maskContentDetail').html("");
							$('.maskContentDetail').append(html);
							$('.maskContent').css('display','block');
							$('.maskContent').css('visiblity','visible');
							
							//$('.maskContent').animate({opacity:'none'}, 1500); 
							
							//$('.maskContent').animate({opacity: 1}, 1500); 
							
			//$(e).find("img.shadow").stop().animate({ width: "85px", height: "20px", marginLeft: "10px", opacity: 0.25 }, 250);
	        //$(e).find("img.shadow").stop().animate({ width: "65px", height: "10px", marginLeft: "20px", bottom: "-10px", opacity: "none" }, 250);
		
						  }
						});	
				});
			}
			if(box.dom("#eventTable2").length>0){
				
				$('#eventTable2 input').click(function()
				{
					 var pageval=true;
					 
					 if(document.register.txtFname.value=='' || document.register.txtLname.value=='' || document.register.txtEmail.value=='' || document.register.txtTitle.value=='' || document.register.txtPhone.value=='')
					 {
					 alert('Please enter all mandatory fields (*).')
					 pageval=false;
					 }
					 
					 
					 if (pageval==true)
					 {
					 
					    document.register.submit();
					  
					        	
					 }
				});
			}
			//end zakeer 
			//end zakeer 
		  }
		});
		
		return false;
	}
	
	var urlString = document.location.href;
	
	redirectUrl(urlString);	
	leftContent(urlString);
	$('ul li a').click(function(){		
		var typeUrlString = $(this).attr('href');
		window.scrollTo(0,0);     
		//var typeIndex = typeUrlString.indexOf("type")+1;
		$('#wrapper').removeClass('type0').removeClass('type1').removeClass('type2').removeClass('type3').removeClass('type4');
		//alert(typeUrlString.indexOf("type0")+1>0);
		
		if(typeUrlString.indexOf("type0")+1>0){
			$('#wrapper').addClass('type0');
		}
		else if(typeUrlString.indexOf("type1")+1>0) {
				$('#wrapper').addClass('type1');			
		}
		else if (typeUrlString.indexOf("type2")+1>0) {
				$('#wrapper').addClass('type2');
		}
		else if (typeUrlString.indexOf("type3")+1>0) {
				$('#wrapper').addClass('type3');
		}
		else if (typeUrlString.indexOf("type4")+1>0) {
		
				$('#wrapper').addClass('type4');
		}
		
		var urlString = $(this).attr('href');
		redirectUrl(urlString);
		leftContent(urlString);

	});
	
	
			
});



function querySt() 
{
    hu = window.location.search.substring(1);

    if (hu.substring(hu.indexOf("=")+1,hu.length)=="SharePoint.htm")
    {

    window.open('brochures/Brochure_SharePoint.pdf')
    }
    else if (hu.substring(hu.indexOf("=")+1,hu.length)=="ApplicationDevelopment.htm")
    {
    window.open('brochures/Brochure_AppDev.pdf')
    }
    else if (hu.substring(hu.indexOf("=")+1,hu.length)=="advanced-network-infrastruture.htm")
    {
    window.open('brochures/Brochure_Advanced Network Infrastructure.pdf')
    }
    else
    if (hu.substring(hu.indexOf("=")+1,hu.length)=="DatabaseManagement.htm")
    {
    window.open('brochures/brochure_databaseSolutions.pdf')
    }
    else
    if (hu.substring(hu.indexOf("=")+1,hu.length)=="InformationManagement.htm")
    {
    window.open('brochures/Brochure_InfoMangement.pdf')
    }
    else if (hu.substring(hu.indexOf("=")+1,hu.length)=="InternetVault.htm")
    {
    window.open('brochures/Brochure_Internet Vault.pdf')
    }
    
    
     else if (hu.substring(hu.indexOf("=")+1,hu.length)=="SAN.htm")
    {
    window.open('brochures/Brochure_DataStorageSolutions.pdf')
    }   
    
    
     else if (hu.substring(hu.indexOf("=")+1,hu.length)=="Backup.htm")
    {
    window.open('brochures/Brochure_DataStorageSolutions.pdf')
    }       
    
    
    
    
    else if (hu.substring(hu.indexOf("=")+1,hu.length)=="advanced-microsoft-solutions.htm")
    {

    window.open('brochures/Brochure_Advanced Microsoft Solutions.pdf')
    }
    else if (hu.substring(hu.indexOf("=")+1,hu.length)=="advanced-network-infrastruture.htm")
    {
    window.open('brochures/Brochure_Advanced Network Infrastructure.pdf')
    }
    else
    if (hu.substring(hu.indexOf("=")+1,hu.length)=="asset-dispostion.htm")
    {
    window.open('brochures/Brochure_Asset Disposition.pdf')
    }
    else
    if (hu.substring(hu.indexOf("=")+1,hu.length)=="change-management.htm")
    {
    window.open('brochures/Brochure_Change Management.pdf')
    }
    else if (hu.substring(hu.indexOf("=")+1,hu.length)=="data-center-services.htm")
    {
    window.open('brochures/Brochure_DataCenter.pdf')
    }
    
    
    
    
    else if (hu.substring(hu.indexOf("=")+1,hu.length)=="deployment-services.htm")
    {

    window.open('brochures/brochure_deployment services.pdf')
    }
    else if (hu.substring(hu.indexOf("=")+1,hu.length)=="e-commerce.htm")
    {
    window.open('brochures/Brochure_eCommerce.pdf')
    }
    
    else
    if (hu.substring(hu.indexOf("=")+1,hu.length)=="eProcurement.htm")
    {
    window.open('brochures/Brochure_eProcurement.pdf')
    }
  
    else if (hu.substring(hu.indexOf("=")+1,hu.length)=="green-technology-solutions.htm")
    {
    window.open('brochures/Brochure_Green Iniatives.pdf')
    }
    
    
    
    
    else if (hu.substring(hu.indexOf("=")+1,hu.length)=="InternetVault.htm")
    {

    window.open('brochures/Brochure_Internet Vault.pdf')
    }
    else if (hu.substring(hu.indexOf("=")+1,hu.length)=="it-life-cycle-service.htm")
    {
    window.open('brochures/Brochure_it lifecycle solutions.pdf')
    }
    else if (hu.substring(hu.indexOf("=")+1,hu.length)=="managed-service.htm")
    {
    window.open('brochures/Brochure_Managed Services.pdf')
    }
    else
    if (hu.substring(hu.indexOf("=")+1,hu.length)=="managed-print-analysis-process.htm")
    {
    window.open('brochures/brochure_MPS.pdf')
    }
    else
    if (hu.substring(hu.indexOf("=")+1,hu.length)=="SCServiceDesk.htm")
    {
    window.open('brochures/Brochure_Service Desk.pdf')
    }
//////    else if (hu.substring(hu.indexOf("=")+1,hu.length)=="")
//////    {
//////    window.open('brochures/brochure_staffing.pdf')
//////    }
    
    else if (hu.substring(hu.indexOf("=")+1,hu.length)=="staging-and-configuration.htm")
    {

    window.open('brochures/Brochure_Staging and Configuration.pdf')
    }
    else if (hu.substring(hu.indexOf("=")+1,hu.length)=="supply-chain-management.htm")
    {
    window.open('brochures/Brochure_Supply Chain Management.pdf')
    }
    else if (hu.substring(hu.indexOf("=")+1,hu.length)=="unified-communications.htm")
    {
    window.open('brochures/Brochure_Unified Communications.pdf')
    }
    else
    if (hu.substring(hu.indexOf("=")+1,hu.length)=="virtualization-services.htm")
    {
    window.open('brochures/Brochure_Virtualization Services.pdf')
    }
    
    
    
    
    
    
}
function settitle()
        {   
        
     hu = window.location.search.substring(1);
     
     if (hu.substring(hu.indexOf("=")+1,hu.length)=="corporate-overview.htm")
    {
    document.title = 'Corporate Overview'
    }
    
    else if (hu.substring(hu.indexOf("=")+1,hu.length)=="OfficeLocations.htm")
    {
    document.title = 'Office Locations'
    }
    else
    if (hu.substring(hu.indexOf("=")+1,hu.length)=="career.htm")
    {
    document.title = 'Careers'
    }
    else
    if (hu.substring(hu.indexOf("=")+1,hu.length)=="IndustryAwardsandRecognition.htm")
    {
    document.title = 'Industry Awards & Recognition'
    }
    else if (hu.substring(hu.indexOf("=")+1,hu.length)=="CSR.htm")
    {
    document.title = 'SIGMAnet Corporate Social Responsibility';
    }   
     if (hu.substring(hu.indexOf("=")+1,hu.length)=="TechnicalExpertise.htm")
    {
    document.title = 'Technical Expertise'
    }
     else if (hu.substring(hu.indexOf("=")+1,hu.indexOf("=")+15)=="contact-us.htm")
    {
    document.title = 'Contact US'
    
    if (hu.substring(hu.indexOf("?")+1,hu.indexOf("?")+6)=="valid")
        {
        
            $('.mask').animate({ 
			opacity: 'show'
			}, 1500 );
			$.ajax({
			url: "Thank_You_Notes.htm",
			cache: false,
			success: function(html){
			$('.maskContentDetail').html("");
			$('.maskContentDetail').append(html);
			$('.maskContentThankyou').css('display','block');
			$('.maskContentThankyou').css('visiblity','visible');
        	}
						        });	
        }
        else if (hu.substring(hu.indexOf("?")+1,hu.indexOf("?")+8)=="invalid")
        {
        alert("Problem in sending mail please send after some time")
        }
    }
    else if (hu.substring(hu.indexOf("=")+1,hu.length)=="Products.htm")
    {
    document.title = 'Products'
    }
    else
    if (hu.substring(hu.indexOf("=")+1,hu.length)=="Solutions.htm")
    {
    document.title = 'Solutions'
    }
    else
    if (hu.substring(hu.indexOf("=")+1,hu.length)=="advanced-technology-solutions.htm")
    {
    document.title = 'Advanced Technology Solutions [ATS]'
    }
    else if (hu.substring(hu.indexOf("=")+1,hu.length)=="information-life-cycle-service.htm")
    {
    document.title = 'IT Life Cycle Services [ITLS]';
    }  
    
     if (hu.substring(hu.indexOf("=")+1,hu.length)=="managed-service.htm")
    {
    document.title = 'SIGMAnetCARE Managed Services'
    }
    else if (hu.substring(hu.indexOf("=")+1,hu.length)=="IMS_Landing.htm")
    {
    document.title = 'Information Management Solutions'
    }
    else if (hu.substring(hu.indexOf("=")+1,hu.length)=="partners.htm")
    {
    document.title = 'Partners'
    }
    else
    if (hu.substring(hu.indexOf("=")+1,hu.length)=="News.htm")
    {
    document.title = 'News'
    }
    else
    if (hu.substring(hu.indexOf("=")+1,hu.length)=="Activeevents.htm")
    {
    document.title = 'Events'
    }
    else if (hu.substring(hu.indexOf("=")+1,hu.length)=="EventArchives.htm")
    {
    document.title = 'Event Archives';
    }   
    if (hu.substring(hu.indexOf("=")+1,hu.length)=="e-commerce.htm")
    {
    document.title = 'IT Lifecycle Services Online Portal'
    }
     if (hu.substring(hu.indexOf("=")+1,hu.length)=="eProcurement.htm")
    {
    document.title = 'eProcurement'
    }
    else if (hu.substring(hu.indexOf("=")+1,hu.length)=="unified-communications.htm")
    {
    document.title = 'Unified Communications'
    }
    else if (hu.substring(hu.indexOf("=")+1,hu.length)=="virtualization-services.htm")
    {
    document.title = 'Virtualization Services'
    }
    else
    if (hu.substring(hu.indexOf("=")+1,hu.length)=="data-center-services.htm")
    {
    document.title = 'Data Center Services'
    }
    else
    if (hu.substring(hu.indexOf("=")+1,hu.length)=="advanced-network-infrastruture.htm")
    {
    document.title = 'Advanced Network Infrastructure'
    }
    else if (hu.substring(hu.indexOf("=")+1,hu.length)=="advanced-microsoft-solutions.htm")
    {
    document.title = 'Advanced Microsoft Solutions';
    }
     if (hu.substring(hu.indexOf("=")+1,hu.length)=="Security.htm")
    {
    document.title = 'Security'
    }
    else if (hu.substring(hu.indexOf("=")+1,hu.length)=="supply-chain-management.htm")
    {
    document.title = 'Supply Chain Management'
    }
    else if (hu.substring(hu.indexOf("=")+1,hu.length)=="staging-and-configuration.htm")
    {
    document.title = 'Staging and Configurations'
    }
    else
    if (hu.substring(hu.indexOf("=")+1,hu.length)=="deployment-services.htm")
    {
    document.title = 'Deployment Services'
    }
    else
    if (hu.substring(hu.indexOf("=")+1,hu.length)=="change-management.htm")
    {
    document.title = 'Change Management'
    }
    else if (hu.substring(hu.indexOf("=")+1,hu.length)=="service-desk.htm")
    {
    document.title = 'Service Desk';
    }  
    
     if (hu.substring(hu.indexOf("=")+1,hu.length)=="asset-dispostion.htm")
    {
    document.title = 'Asset Disposition '
    }
    else if (hu.substring(hu.indexOf("=")+1,hu.length)=="it-life-cycle-service.htm")
    {
    document.title = 'Information Technology LifeCycle Solutions and Services'
    }
    else if (hu.substring(hu.indexOf("=")+1,hu.length)=="managed-service.htm")
    {
    document.title = 'Managed Services '
    }
    else
    if (hu.substring(hu.indexOf("=")+1,hu.length)=="SCServiceDesk.htm")
    {
    document.title = 'Service Desk'
    }
    else
    if (hu.substring(hu.indexOf("=")+1,hu.length)=="ITInfrastructure.htm")
    {
    document.title = 'IT Infrastructure'
    }
    else if (hu.substring(hu.indexOf("=")+1,hu.length)=="InternetVault.htm")
    {
    document.title = 'Internet Vault';
    }   
     if (hu.substring(hu.indexOf("=")+1,hu.length)=="managed-print-analysis-process.htm")
    {
    document.title = 'Managed Print Services'
    }
    else if (hu.substring(hu.indexOf("=")+1,hu.length)=="InformationManagement.htm")
    {
    document.title = 'Information Management'
    }
    else if (hu.substring(hu.indexOf("=")+1,hu.length)=="ApplicationDevelopment.htm")
    {
    document.title = 'Application Development'
    }
    else
    if (hu.substring(hu.indexOf("=")+1,hu.length)=="SharePoint.htm")
    {
    document.title = 'SharePoint'
    }
    else
    if (hu.substring(hu.indexOf("=")+1,hu.length)=="DatabaseManagement.htm")
    {   
    document.title = 'Database Solution'
    }
    else if (hu.substring(hu.indexOf("=")+1,hu.length)=="benifits.htm")
    {
    document.title = 'Benifits';
    }
    else if (hu.substring(hu.indexOf("=")+1,hu.length)=="job-openings.htm")
    {
    document.title = 'Job-Openings';
    }
else if (hu.substring(hu.indexOf("=")+1,hu.length)=="green-technology-solutions.htm")
    {
    document.title = 'Green Technology Solutions';
    }
else if (hu.substring(hu.indexOf("=")+1,hu.length)=="CaseStudy_SP.htm")
    {
    document.title = 'Case Study: Microsoft Office SharePoint Server 2007';
    }
    else if (hu.substring(hu.indexOf("=")+1,hu.length)=="CaseStudy_ITAM.htm")
    {
    document.title = 'Case Study: IT Asset Management Services';
    }
        }
