// Script for copy right year
$(".copywriteyr").append('&copy; 2010');
// Main products dropdown
function mouseenter1(){
      $('#mainProductslist').addClass('hover');
	  $('#dropDownMenu').slideDown(400);
	  $("#mainProducts").unbind('mouseenter');
	  var drpDwnMenu = document.getElementById("dropDownMenu");
	  var prdnameMenu1 = document.getElementById("mainProductslist");
	  var divwidth = drpDwnMenu.offsetWidth;
	  drpDwnMenu.style.left = findPosX(prdnameMenu1)-divwidth+198+"px";
	  drpDwnMenu.style.top =  findPosY(prdnameMenu1)+27+"px";
    }
	function mouseout1(){
      $('#mainProductslist').removeClass('hover');
      $('#dropDownMenu').slideUp(200);
	   setTimeout("$(\"#mainProducts\").bind(\"mouseenter\",mouseenter1)",'200');
    }
	
	// support dropdown
function showSupport(){
      $('#supportDetails').addClass('hover');
	  $('#supportMenu').slideDown(200);
	  $("#supportDiv").unbind('mouseenter');
	  var drpDwnMenu = document.getElementById("supportMenu");
	  var prdnameMenu1 = document.getElementById("supportDetails");
	  var divwidth = drpDwnMenu.offsetWidth;
	  drpDwnMenu.style.left = findPosX(prdnameMenu1)-divwidth+198+"px";
	  drpDwnMenu.style.top =  findPosY(prdnameMenu1)+27+"px";
    }
	function hideSupport(){
      $('#supportDetails').removeClass('hover');
      $('#supportMenu').slideUp(200);
	   setTimeout("$(\"#supportDiv\").bind(\"mouseenter\",showSupport)",'200');
    }
	
// Allproducts dropdown
function showproducts1()
	{
      $('#Products').addClass('hover');
	  $('#allProductsdiv').slideDown(300);
	  $(".productsDIV").unbind('mouseenter');
	  var drpDwnDiv = document.getElementById("allProductsdiv");
	  var prdnamediv = document.getElementById("Products");
	  var divwidth = 	drpDwnDiv.offsetWidth;
	  drpDwnDiv.style.left = findPosX(prdnamediv)-divwidth+100+"px";
	  drpDwnDiv.style.top =  findPosY(prdnamediv)+"px";
    }
function hideproducts1()
	{
      $('#Products').removeClass('hover');
      $('#allProductsdiv').slideUp(200);
	   setTimeout("$(\".productsDIV\").bind(\"mouseenter\",showproducts1)",'200');
    }
// Finding X, Y position
	function findPosX(obj) {
	var curleft = 0;
	if (document.getElementById || document.all) {
		while (obj.offsetParent) {
			curleft += obj.offsetLeft;
			obj = obj.offsetParent;
		}
	} 
	else if (document.layers) {
		curleft += obj.x;
	}
	return curleft;
}
//  Retruns the x position of the given object in the window / screen.
function findPosY(obj) {
	var curtop = 0;
	if (document.getElementById || document.all) {
		while (obj.offsetParent) {
			curtop += obj.offsetTop;
			obj = obj.offsetParent;
		}
	} else if (document.layers) {
		curtop += obj.y;
	}
	return curtop;
}

// Business Image toggle
var flip = 0;
    $("#imgReducer").click(function () {
	if(flip%2==0)
	{
    	$("#imgReducer").removeClass("imgHide");		
		$("#imgReducer").addClass("imgShow");
	}
	else
	{
    	$("#imgReducer").removeClass("imgShow");		
		$("#imgReducer").addClass("imgHide");
	}
      $("#businessImage").toggle( flip++ % 2 == 1 );
    });
	
<!-- Pop up Script -->
function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=yes,status=yes,location=0,statusbar=0,menubar=0,resizable=yes,width=500,height=600,left = 262,top = 134');");
}
function popitup(url) {
	newwindow=window.open(url,'name','height=550,width=700,scrollbars=yes');
	if (window.focus) {newwindow.focus()}
	return false;
}
function popupchatwindow(url) { 
	newwindow=window.open(url,'name','height=430,width=380,scrollbars=yes');
	if (window.focus) {newwindow.focus()}
	return false;
}
<!-- feedback script -- >
function hidePopUp(){ document.getElementById('feedbackCont').style.display="none"; }function feedbackPopUp(){ document.getElementById('feedbackCont').style.display="block"; var leftval; if(document.all){ leftval=(screen.width/2)-200; }else if(document.getElementById){ leftval=(document.width/2)-235; } document.getElementById('feedStyle').style.marginLeft=leftval; }
<!-- feedback script -- >
<!-- product solution popup Script start -->
function getDocObj(id)
{
	return document.getElementById(id);
}

function hideDiv(id, disid)
{
	getDocObj(id).style.display = 'none';
	getDocObj(disid).style.display = 'none';
}

function dragdrop(ev, id)
{
	captureSB(ev,id);
}

function detailviewPopup(tit, cont, wid, ev)
{
	var content = getDocObj("CAcontent");
	var title = getDocObj("CAtitle");
	var mainContainer = getDocObj("viewContainer");
	var header = getDocObj("CAheader");
	title.innerHTML = tit;
	content.innerHTML = getDocObj(cont).innerHTML;
	//header['onmousedown'] = function(event){dragdrop(event,'viewContainer')};
	mainContainer.style.width = wid + "px";
	mainContainer.style.display = 'block';	
//	mainContainer.style.left = document.body.scrollTop + 20% + "px";
//	mainContainer.style.top = document.body.scrollTop + 100 + "px";
	var disDiv = getDocObj("disableDiv");
	disDiv.style.display = 'block';
}
<!-- product solution popup Script end -->


<!--Image two links script (SDP - MSP and FD) -->

function setCookie(name, value)
{
    var str = name + "=" + value + "; path=/;";    //No I18n
    document.cookie = str;
}

function getCookie(c_name)
{
    if (document.cookie.length>0)
    {
        var c_start=document.cookie.indexOf(c_name + "=");
        if(c_start!=-1)
        {
            var c_start = c_start + c_name.length+1;
            var c_end = document.cookie.indexOf(";",c_start);
            if(c_end == -1)
            {
                c_end=document.cookie.length;
            }
            return unescape(document.cookie.substring(c_start,c_end));
        }
    }
    return "";
}

function reloadimg()
{
	var firstimg = getCookie('firstimg');
	if(firstimg == '' || firstimg == 'imgref2')
	{
	    var slide1 = document.getElementById('imgobj');
		slide1.src = 'https://www.manageengine.com/products/service-desk/images/sdp-msp-beta.gif';
		slide1.style.cursor = 'pointer';
		slide1.onclick = function(){firstlink();}
		setCookie('firstimg', 'imgref1');
	}
	else
	{
		var slide2 = document.getElementById('imgobj');
		slide2.src = 'https://www.manageengine.com/products/service-desk/images/cmms-software.gif';
		slide2.style.cursor = 'pointer';
		slide2.onclick = function(){secondlink();}
		setCookie('firstimg', 'imgref2');
	}
}

function firstlink()
{
window.open('https://www.manageengine.com/products/service-desk-msp/index.html?sdp')
}
function secondlink()
{
window.open('https://www.manageengine.com/products/facilities-desk/cmms-software.html?sdp')
}

<!--Image two links script (SDP - MSP and FD) end -->
