﻿
document.write('<script type="text/javascript" src="/jsfiles/iehover-fix.js"><\/script>');
document.write('<script type="text/javascript" src="/jsfiles/dw_event.js"><\/script>');
document.write('<script type="text/javascript" src="/jsfiles/dw_rotator.js"><\/script>');
document.write('<script type="text/javascript" src="/jsfiles/calendarDateInput.js"><\/script>');
//document.write('<link href="/Styles/styles.css" rel="stylesheet" type="text/css" />');
//document.write('<link href="/Styles/nav.css" rel="stylesheet" type="text/css" />');


    function sendEmail(name, domain) {
        location.href = 'mailto:' + name + '@' + domain;
    }

    function writeEmail(name, domain) {
        document.write(name + '@' + domain);
    }

    function openURL(httpURL) {
        location.href = httpURL
    }

    function openLiveCycle(campId,compname)
    { 
  //  alert(campId)
 
    //Dialog.alert({url: "editpage.php", options: {method: 'get'}}, 
    // {className: "alphacube", width:450, height:450, okLabel: "Close"});
        var master = new Window("master" + campId, { className: "alphacube", url: "/admin/news/ProductLCDetails.aspx?camId=" + campId + "&comp=" + compname, width: 700, height: 350 });
    master.setDestroyOnClose();
    master.showCenter();
    }
    
     
    function openLiveCyclePnSignup(pId,pName)
    { 
        //alert(campId)

        //Dialog.alert({url: "editpage.php", options: {method: 'get'}}, 
        // {className: "alphacube", width:450, height:450, okLabel: "Close"});
        var master = new Window("master" + pId, { className: "alphacube", url: "/admin/news/pnSignupPersonDetails.aspx?pnId=" + pId + "&pName= ", width: 700, height: 350 });
        master.setDestroyOnClose();
        master.showCenter();
    }
//	<!-- Add-On Settings -->	

		/*******  Menu 0 Add-On Settings *******/
//		var a = qmad.qm0 = new Object();

//		// Slide Animation Add On
//		a.slide_animation_frames = 20;
//		a.slide_accelerator = 1;
//		a.slide_sub_subs_left_right = true;
    //		a.slide_offxy = 1;



    function CalcKeyCode(aChar) {
        var character = aChar.substring(0, 1);
        var code = aChar.charCodeAt(0);
        return code;
    }

    function checkNumber(val) {
        var strPass = val.value;
        var strLength = strPass.length;
        var lchar = val.value.charAt((strLength) - 1);
        var cCode = CalcKeyCode(lchar);

        /* Check if the keyed in character is a number
        do you want alphabetic UPPERCASE only ?
        or lower case only just check their respective
        codes and replace the 48 and 57 */

        if (cCode < 48 || cCode > 57) {
            var myNumber = val.value.substring(0, (strLength) - 1);
            val.value = myNumber;
        }
        return false;
    }








    function trimAll(sString) {
        while (sString.substring(0, 1) == ' ') {
            sString = sString.substring(1, sString.length);
        }
        while (sString.substring(sString.length - 1, sString.length) == ' ') {
            sString = sString.substring(0, sString.length - 1);
        }
        return sString;
    }



    function isValidEmail(email, required) {
        if (required == undefined) {   // if not specified, assume it's required
            required = true;
        }
        if (email == null) {
            if (required) {
                return false;
            }
            return true;
        }
        if (email.length == 0) {
            if (required) {
                return false;
            }
            return true;
        }
        if (!allValidChars(email)) {  // check to make sure all characters are valid
            return false;
        }
        if (email.indexOf("@") < 1) { //  must contain @, and it must not be the first character
            return false;
        } else if (email.lastIndexOf(".") <= email.indexOf("@")) {  // last dot must be after the @
            return false;
        } else if (email.indexOf("@") == email.length) {  // @ must not be the last character
            return false;
        } else if (email.indexOf("..") >= 0) { // two periods in a row is not valid
            return false;
        } else if (email.indexOf(".") == email.length) {  // . must not be the last character
            return false;
        }
        return true;
    }

    function allValidChars(email) {
        var parsed = true;
        var validchars = "abcdefghijklmnopqrstuvwxyz0123456789@.-_";
        for (var i = 0; i < email.length; i++) {
            var letter = email.charAt(i).toLowerCase();
            if (validchars.indexOf(letter) != -1)
                continue;
            parsed = false;
            break;
        }
        return parsed;
    }

