function IncludeJavaScript(jsFile)
{
window.console.log(jsFile);
  document.write('<script type="text/javascript" src="'
    + jsFile + '"></script>'); 
}

function show(el) {
	
	var o = document.getElementById(el);
	o.style.display = 'block'; 
	
}// JavaScript Document

function hide(el) {
	
	var o = document.getElementById(el);
	o.style.display = 'none'; 
}

function toggle(el) {
	var o = document.getElementById(el);

	if(o.style.display == 'none') o.style.display = 'block';
	else o.style.display = 'none';
}

function slideBlock(obj, btn, hide){
    window.addEvent('domready', function() {
        var temp = new Fx.Slide(obj);
        if(hide) temp.hide();
        $(btn).addEvent('click', function(e){
                e = new Event(e);
                temp.toggle();
                e.stop();
        });
    });
}

function initContact(obj, btn, n, em){
    window.addEvent('domready', function() {
        $(btn).addEvent('click', function(e){
                e = new Event(e);
                addContact($(obj), n, em);
                e.stop();
        });
    });
}

function addContact(obj, n, em){
	//create new form
	div = new Element('div');
	div.addClass('invit');
	div.addClass('rule')
	
	name = new Element('input');
	name.setAttribute('type', 'text');
	name.setAttribute('id', 'name[]');
	name.setAttribute('name', 'name[]');
	name.addClass('invite_name');
	div.appendText(n+': ');
	name.injectInside(div);

	
	email = new Element('input');
	email.setAttribute('type', 'text');
	email.setAttribute('id', 'email[]');
	email.setAttribute('name', 'email[]');
	email.addClass('invite_email');
	div.appendText(em+': ');
	email.injectInside(div);

	div.injectInside(obj);
}

function doaction(action){
        //strip actions;
        var ref = location.href;
        var id = ref.indexOf('?');
        if(id > -1) ref = ref.substr(0, id);
        location.href = ref+'?'+action ;
}

function initProgressBar(id, percentage){
        window.addEvent('domready', function() {
                imageWidth		= 240;
                initialPos		= (imageWidth / 2) * (-1);
		pxPerPercent	        = (imageWidth / 2) / 100;
                if (percentage < 0)	percentage = 0;
		if (percentage > 100)	percentage = 100;
                p = percentage;
                var marginChange = new Fx.Style(id + "_percentImage", 'backgroundPosition', {duration:500});
                marginChange.start(this.initialPos, (this.initialPos + (p * this.pxPerPercent)));
        });
}

function selectTags(){
        window.addEvent('domready', function() {
                var selectedTags = [];
               taglist = $$('.tag');
               taglist.each(function(tag, i){
                        tag.addEvent('click', function(e){
                                if(!tag.hasClass('active')){
                                        selectedTags[tag.getProperty('id')] = tag.getProperty('id');
                                        tag.addClass('active');
                                } else {
                                        selectedTags[tag.getProperty('id')] = 0;
                                        tag.removeClass('active');
                                }
                        });
                });
               qlist = $$('.question');
               qlist.each(function(quest, i){
                        quest.addEvent('click', function(e){
                                var ref = location.href;
                                var id = ref.indexOf('?');
                                if(id > -1) ref = ref.substr(0, id);
                                qid = quest.getProperty('id');
                                qid = qid.substr(2,qid.length);
                                
                                ids = '';
                                for(var i=0;i<selectedTags.length; i++){
                                        if(selectedTags[i] > 0) ids += '_'+selectedTags[i];
                                }
                                ids = ids.substr(1,ids.length);
                                location.href = ref+'?action=fitqtags&questionid='+qid+'&tagids='+ids;
                        });
                });
        });
}

function selectPTags(){
        window.addEvent('domready', function() {
                var selectedTags = [];
               taglist = $$('.tag');
               taglist.each(function(tag, i){
                        tag.addEvent('click', function(e){
                                if(!tag.hasClass('active')){
                                        selectedTags[tag.getProperty('id')] = tag.getProperty('id');
                                        tag.addClass('active');
                                } else {
                                        selectedTags[tag.getProperty('id')] = 0;
                                        tag.removeClass('active');
                                }
                        });
                });
               qlist = $$('.photo');
               qlist.each(function(quest, i){
                        quest.addEvent('click', function(e){
                                var ref = location.href;
                                var id = ref.indexOf('?');
                                if(id > -1) ref = ref.substr(0, id);
                                qid = quest.getProperty('id');
                                //qid = qid.substr(2,qid.length);
                                
                                ids = '';
                                for(var i=0;i<selectedTags.length; i++){
                                        if(selectedTags[i] > 0) ids += '_'+selectedTags[i];
                                }
                                ids = ids.substr(1,ids.length);
                                location.href = ref+'?action=fitptags&photoid='+qid+'&tagids='+ids;
                        });
                });
        });
<<<<<<< .mine
}

function doaction(action){
        //strip actions;
        var ref = location.href;
        var id = ref.indexOf('?');
        if(id > -1) ref = ref.substr(0, id);
        location.href = ref+'?'+action ;
}
=======
}

function setParentFormValue(id,val){
        /*
        window.addEvent('domready', function() {
                if(parent){
                        input = parent.document.getElementsByTagName('body');
                        if(input) input.setValue(val);
                }
        });
        */
}

//var query = new XSSInterface.Query();

function sendColor() {
	window.xssCaller.call("setColor", "#ff0000")
}

function callForm(domain, path, channel, func, vars) {
	window.addEvent('domready', function(){
                debug('calling forms');
                /*
                var query = new XSSInterface.Query();
                window.xssCaller               = new XSSInterface.Caller(domain,path+"/cookie_setter.html",channel, window.parent);
                window.xssCaller.securityToken = query.param("securityToken");
                window.xssCaller.call('test', 'test');
                */
                //window.xssCaller.call(func, vars);
        //window.xssCaller.call("sendForm", "#ff0000");
        });
}

function debug(log){
        /*
        if(window.console){
               window.console.log(log); 
        }
        else window.alert(log);
        */
}


window.addEvent('domready', function(){
    if(window.ie6) {
        $$('fixPNG').each(function(fixme){
                fixPNG(fixme);
        });
    }
});


>>>>>>> .r61
