function setCookieLogin(c_name,value,expiredays)
{
//var exdate=new Date();
//exdate.setDate(exdate.getDate()+expiredays);

var futdate = new Date()		//Get the current time and date
var expdate = futdate.getTime()  //Get the milliseconds since Jan 1, 1970
expdate += 3600*1000*3  //expires in 3 hour(milliseconds)
futdate.setTime(expdate)
document.cookie=c_name+ "=" +escape(value)+
((expiredays==null) ? "" : ";expires="+futdate.toGMTString())+"; path=/; domain=.linesmaker.com";
setCookieLogin2("user",value,30);
}

function setCookieLogin2(c_name,value,expiredays)
{
var exdate=new Date();
exdate.setDate(exdate.getDate()+expiredays);
document.cookie=c_name+ "=" +escape(value)+
((expiredays==null) ? "" : ";expires="+exdate.toGMTString())+"; path=/; domain=.linesmaker.com";
}


function getCookie(c_name)
{
if (document.cookie.length>0)
  {
  c_start=document.cookie.indexOf(c_name + "=");
  if (c_start!=-1)
    {
    c_start=c_start + c_name.length+1;
    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 deleteCookie(name) {
	setCookieLogin2(name,"",-1);
}

function showhide(id){
	if (document.getElementById){
		username=getCookie("LMPMS");
		obj = document.getElementById(id);
		if (username!=null && username!=""){
			if (obj.style.display == "none"){
			obj.style.display = "";
			} else {
			obj.style.display = "none";
			}
		}
	}
}
/* CLEAR FIELD */
   $(document).ready(function() {         

			$(".dropdown img.flag").addClass("flagvisibility");
            $(".dropdown dt a").click(function() {
                $(".dropdown dd ul").toggle();
            });                    

            $(".dropdown dd ul li a").click(function() {

                var text = $(this).html();

                $(".dropdown dt a span").html(text);

                $(".dropdown dd ul").hide();

                $("#result").html("Selected value is: " + getSelectedValue("sample"));

            });
                        

            function getSelectedValue(id) {

                return $("#" + id).find("dt a span.value").html();

            }

            $(document).bind('click', function(e) {

                var $clicked = $(e.target);

                if (! $clicked.parents().hasClass("dropdown"))

                    $(".dropdown dd ul").hide();

            });

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

                $(".dropdown img.flag").toggleClass("flagvisibility");

            });

        });
   
   //EXPANDABLE ITEM SCRIPTS
//SINGLE EXPAND ITEM FUNCTION; NO MULTIPLE ITEMS HANDLING
function expandItem(obj)
{
	var el = document.getElementById(obj);
	var ar = document.getElementById("expDiv").getElementsByTagName("div");
	var ex = document.getElementById("ex"+obj);
	if(el.style.display != "block")
	{
		el.style.display = "block";
		ex.innerHTML = '[—]';
	}
	else
	{
		el.style.display = "none";
		ex.innerHTML = '[+]';
	}
}
  //END EXPANDABLE ITEM SCRIPTS